Robots.txt: what it can and cannot do for SEO
The most powerful text file on a website is also the most misunderstood. It is a request about crawling, and nothing more.
Robots.txt tells crawlers which URLs they may fetch. It does not keep a page out of Google: a blocked URL can still be indexed if other pages link to it. To keep a page out of results, allow crawling and use a noindex tag, or put the page behind a password.
Robots.txt is a plain text file at the root of a host, read before a crawler fetches anything else. Google's introduction says it exists mainly to avoid overloading a site with requests, and states plainly that it is not a way to keep a page out of Google. That one sentence explains most robots.txt mistakes we see in audits. It is the first item on our technical SEO checklist.
What it controls, and what it does not
| You want to | Use | Why not robots.txt |
|---|---|---|
| Stop crawlers wasting requests on endless filter or search URLs | robots.txt disallow | This is what it is for |
| Keep a page out of search results | noindex meta tag or X-Robots-Tag header | A blocked page can still be indexed from links, and Google cannot see a noindex on a page it may not crawl |
| Keep a page private | Password or login | The file is public; listing a secret path advertises it |
| Choose between duplicate URLs | Redirect or rel="canonical" | Google's canonical guidance says not to use robots.txt for canonicalisation |
How Google reads the file
- The most specific rule wins. Google's specification page works through examples where an allow rule beats a disallow rule because its path is longer. When two matching rules are equally specific, Google uses the least restrictive one.
- Paths are case-sensitive. Disallowing /Private/ does not block /private/.
- Size has a limit. Google reads the first 500 kibibytes of the file and ignores the rest.
- Errors matter differently. If robots.txt returns a 4xx error (other than 429), Google treats it as if there were no restrictions. A 5xx or 429 is treated as a temporary block on crawling the whole site, and Google explains what it does if that lasts.
- It is a standard now. The Robots Exclusion Protocol was published by the IETF as RFC 9309 in September 2022, after decades as an informal convention.
Five mistakes worth checking for
- Disallowing a page you also set to noindex. Google cannot read a tag on a page it is not allowed to fetch, so the noindex never takes effect.
- Blocking CSS or JavaScript. Google renders pages; if it cannot fetch the files that build the page, it may see a broken one.
- A staging rule left in production. "Disallow: /" copied from a test site switches off crawling for everything. It is the first line we read in any audit.
- Trying to hide private pages. Anyone can open the file and see the paths you listed.
- No sitemap line. It is optional, but a Sitemap: line is the cheapest way to tell every crawler where your list of URLs lives. Ours is covered in XML sitemaps that Google uses.
Our own file, as a worked example
We checked colleviate.com's robots.txt on 5 December 2026. It allows every crawler everything, names seventeen crawlers individually (Googlebot, Bingbot, GPTBot, ClaudeBot, PerplexityBot and others) with the same allow rule, and ends with the sitemap line. Naming them changes nothing technically, because the wildcard group already allows them; we did it so a reader can see the decision was deliberate. Our reasoning for letting AI crawlers in is in our llms.txt piece: our Insights are written to be quoted. A publisher that sells its archive would reasonably decide differently.
How to test a change before it ships
Read the file at yourdomain/robots.txt in a browser, then use the URL Inspection tool in Search Console on two or three important URLs; it reports whether crawling is allowed. Search Console's robots.txt report shows which versions Google fetched and any parse problems. If pages vanish from results after a change, our Search Console diagnostics guide sets out the order in which to look.
Sources
- Introduction to robots.txt, Google Search Central, undated
- How Google interprets the robots.txt specification, Google Search Central, undated
- RFC 9309: Robots Exclusion Protocol, IETF, September 2022
- Robots meta tag, data-nosnippet and X-Robots-Tag specifications, Google Search Central, undated
- Colleviate technical check of colleviate.com (site build and live HTTP responses), Colleviate, 5 Dec 2026
Questions we get asked
Does robots.txt stop a page being indexed?
No. It controls crawling. A blocked URL can still be indexed if other pages link to it. Use a noindex tag on a crawlable page instead.
Should I block CSS and JavaScript in robots.txt?
No. Google renders pages and needs those files to see the page as a visitor does.
What happens if robots.txt returns an error?
Google treats a 4xx (except 429) as no restrictions, and a 5xx or 429 as a temporary block on crawling the site.
Is robots.txt an official standard?
Yes. The Robots Exclusion Protocol was published as RFC 9309 by the IETF in September 2022.
Not sure what your robots.txt is doing?
We read it line by line against your important URLs and tell you what each rule actually blocks.
Ask for a scoped auditWhat we do · How we produce it · Who we do it for · Talk to us