Blocking Your Robots.txt In Google's Search Results

Dec 27, 2012 - 8:42 am 8 by

Have you ever seen your robots.txt file return a match in the Google search results before? Does that upset you? Did you know you can block Google from displaying that file in the search results without blocking Google's access to that file?

This is not a new topic, in 2008 we polled our readers asking if Google should display the robots.txt file in search results and the overwhelming majority said no, Google should not show the content in the search results.

But here is a picture of the robots.txt file showing up in the search results for this site:

robots.txt in google results

But there are ways to block the robots.txt file from showing up in the search results. John Mueller of Google explained it about five years ago:

Hi guys, there are two ways to block your robots.txt from showing up in search results:

- disallow it in your robots.txt (don't worry, we'll still check it); you can then use the Webmaster Tools URL removal tool to have it taken out of the index if it's indexed.

- use the x-robots-tag HTTP header tag with "noindex"

On the other hand, robots.txt URLs generally would not show up in any search results where you have more relevant pages within your site, so this is probably not something you'd want to spend all too much effort on :-).

Forum discussion at StackOverflow and also that old WebmasterWorld thread.

 

Popular Categories

The Pulse of the search community

Follow

Search Video Recaps

 
Google Core Update Rumbling, Manual Actions FAQs, Core Web Vitals Updates, AI, Bing, Ads & More - YouTube
Video Details More Videos Subscribe to Videos

Most Recent Articles

Search Forum Recap

Daily Search Forum Recap: March 18, 2024

Mar 18, 2024 - 4:00 pm
Google Updates

Google Urges Patience As The March 2024 Core Update Continues To Rollout

Mar 18, 2024 - 7:51 am
Google

Official: Google Replaces Perspective Filter With Forums Filter

Mar 18, 2024 - 7:41 am
Google Maps

Google Business Profiles Now Offers Additional Review After Appeal Is Denied

Mar 18, 2024 - 7:31 am
Google Maps

EU Searchers Complaining About Google Maps Features Changes Related To DMA

Mar 18, 2024 - 7:21 am
Google

Google Showing Fewer Sitelinks Within Search

Mar 18, 2024 - 7:11 am
Previous Story: Searchers Can't Exclude Keywords From Google Image Search