robots.txt
A file that tells crawlers which addresses they may fetch. It manages crawling; it does not keep pages out of search.
What you will be able to do
Use robots.txt for what it is for, managing crawling, and avoid the mistakes that hide good pages or leave bad ones in search.
How it reaches growth
- robots.txt
- Crawlers skip addresses that waste their time
- They spend their fetches on pages that can earn visits
- Those pages are found and refreshed sooner
- More organic visits to pages that convert
What it is
robots.txt is a plain text file at the root of a site that tells search engine crawlers which addresses they may fetch. Google says it is used mainly to avoid overloading a site with requests, and to keep crawlers from spending time on unimportant or similar pages.
It is a request, not a lock. Google says its rules cannot force a crawler to obey, and that crawlers may read the same rules differently.
How it works
When Googlebot finds a disallow rule for an address, it does not fetch it. That has a consequence people miss: it cannot see anything on that page, including a noindex rule.
So robots.txt does not keep a page out of Google. Google says a disallowed page can still be indexed if other sites link to it, and can then appear in results with its address but no description. To keep a page out of search, use noindex or put it behind a password.
Blocking the files a page needs to render, such as scripts and style sheets, can stop Google from seeing the page as visitors do. Google's advice is to block such files only if pages loaded without them are not significantly affected.
Why it matters for growth
Used well, robots.txt focuses crawling on pages that can earn visits, which matters most on large sites that generate many near-identical addresses, such as filtered lists.
Used badly, it is one of the fastest ways to lose organic growth: one wrong line can stop a whole section from being fetched. And because blocked pages can still be indexed from links, it can leave bare results in search while hiding the content that would have earned the click.
How to check it
- Read your robots.txt line by line, and write next to each rule what it is meant to block and why.
- Test the addresses of your most valuable pages against it, so none is blocked by accident.
- Look in Search Console for pages indexed even though they are blocked: a sign robots.txt is being asked to hide pages it cannot hide.
Rules of thumb
- Use robots.txt to manage crawling, never to keep pages out of search.
- Never block a page you want removed with noindex: the crawler has to fetch the page to see the rule.
- Change robots.txt with the care of a release, and check your best pages after every change.
Rules of thumb are starting points for a decision, not laws.
Common mistakes
- Blocking pages to hide them, so they stay in search without a description.
- Blocking a page and adding noindex to it, so the noindex is never seen.
- Using robots.txt to choose between duplicate pages. Google advises against it, because disallowed addresses may still be indexed.
- Copying a test site's rule that blocks everything to the live site.
A worked example
A made-up online course platform blocked its internal search pages in robots.txt to keep them out of Google. Other sites had linked to some of those pages, so a few hundred still showed in results, with no description and few clicks.
The fix ran against instinct: allow those addresses to be crawled and add noindex, so Google can fetch them, read the rule and drop them. The platform kept robots.txt blocking the endless sorted versions of its course lists, which it never wanted fetched at all.
The business and its numbers are made up to show the arithmetic.
Practise it: 3 simulations
Each simulation is a different made-up company or site, with the same skill at its heart. Play one here, or open it on its own page. The numbers change every time you play.
On your own product
- Open your site's robots.txt.
- For each disallow rule, write whether its goal is to save crawling or to keep pages out of search.
- Move every rule of the second kind to noindex.
Questions
Can I put noindex in robots.txt?
Google does not support a noindex rule in robots.txt. Use a robots meta tag or an X-Robots-Tag HTTP header on the page itself.
Does blocking an image stop people using it?
No. Google says blocking a file does not stop other pages or people from linking to it.
Do all crawlers follow robots.txt?
robots.txt cannot enforce anything, and crawlers may read its rules differently. Treat it as an instruction to well-behaved crawlers, not as protection.