SEO · Technical SEO
Robots.txt: what it really blocks, and what it doesn't
Robots.txt is a text file at the root of a site that tells crawlers which URLs they can access. It is mainly used to avoid overloading the server and to keep unimportant pages out of crawling. It is not a tool for removing a page from Google: a blocked URL can still be indexed. For that, you need a noindex tag.
Franck Gordi
· 8 min read
Crawling
Robots.txt
Indexing (noindex)
Key takeaways
- Robots.txt manages crawling, not indexing: a blocked URL can appear in Google, without a description.
- To exclude a page from results, Google recommends noindex, a password or removing the page.
- Google reads only four fields: user-agent, allow, disallow and sitemap. Crawl-delay is ignored.
- With conflicting rules, Google applies the most specific rule, then the least restrictive one.
- A 5xx error on the file pauses crawling of the site; a 404 means no restrictions at all.
What is robots.txt for?
According to Google's documentation, robots.txt is used primarily to manage crawler traffic to a site. Its effect depends on the file type:
Effect by file type
Three file types, three effects
- Web page
- Limits crawling if the server risks being overwhelmed, or avoids crawling unimportant or similar pages. The page can stay indexed.
- Media file
- Images, video and audio: blocking manages crawling and also keeps these files out of Google results.
- Resource file
- Minor scripts or styles: block only if the page stays understandable without them. Otherwise Google analyzes the page poorly.
- What it does not do
- It secures nothing: respectable crawlers obey it, others may not. Private information is protected with a password.
Why robots.txt does not prevent indexing
This is the costliest confusion. Google does not crawl blocked content, but it can discover and index the URL if other pages link to it. The address, and sometimes the anchor text of links pointing to it, can then appear in results, with a snippet that has no description.
The reverse trap is just as common: blocking in robots.txt a page that carries a noindex tag. Googlebot no longer crawls the page, so it never reads the noindex, and the URL can stay indexed. Google explicitly warns that combining crawling and indexing rules can cause one rule to counteract another.
The syntax Google actually reads
Google applies the Robots Exclusion Protocol, standardized in RFC 9309, with its own documented interpretation.
Four fields, not one more
Google supports user-agent, allow, disallow and sitemap. Field names are case-insensitive, but paths are case-sensitive. Invalid lines are ignored, and anything after a # is a comment.
Groups and rule precedence
A crawler follows only one group: the one with the most specific user agent. The order of groups in the file is irrelevant. Within a group, the rule with the longest path wins; on a tie, Google uses the least restrictive one. Example from the documentation: with allow: /p and disallow: /, the URL /page stays crawlable.
Wildcards
Google recognizes two wildcards: * for zero or more characters, and $ for the end of the URL. Disallow: /*.pdf$ therefore blocks URLs ending in .pdf.
Status codes: what Google does when the file errors
HTTP status of the file
The status decides crawling
- 2xx
- The file is processed as provided by the server.
- 3xx
- Google follows at least five redirect hops, then treats the file as a 404. It does not follow JavaScript or meta refresh redirects.
- 4xx (except 429)
- Google assumes no valid robots.txt exists, so no restrictions. 401 and 403 do not limit crawl rate.
- 5xx
- For 12 hours, Google stops crawling the site. Then, for up to 30 days, it uses the last good cached version.
Practical consequence: a robots.txt returning a server error during a release can stop crawling of the whole site. It is a point to check during every SEO migration.
Common traps on a site
- Blocking JavaScript or CSS files needed for rendering: Google misunderstands the page, a major risk for the apps covered in our JavaScript SEO article.
- A forgotten file per subdomain: a robots.txt only applies to its host, protocol and port.
app.,docs.andwww.each need their own. - The staging Disallow: / deployed to production, blocking the whole site.
- An oversized file: Google ignores anything beyond 500 KiB.
- Blocking URLs listed in the sitemap: a contradictory signal, as explained in our XML sitemap article.
If the goal is to better allocate Googlebot's crawling, first check that a real crawl budget problem exists: on most sites, robots.txt is not the first lever. A technical SEO project or an SEO audit settles it.
How to check your robots.txt
- Location: at the root of each host, as UTF-8 plain text.
- Status: the file returns 200, never 5xx.
- Resources: no script or style needed for rendering is blocked.
- Indexing: no noindexed page is blocked from crawling.
- Delay: after a change, allow up to 24 hours of caching on Google's side.
Frequently asked questions about robots.txt
Does robots.txt keep a page out of Google?
No. Google states that robots.txt is not a mechanism for keeping a page out of its results. A blocked URL can be indexed if other pages link to it, and appear without a description. To exclude it, use noindex, password protection or remove the page.
Can I combine Disallow and noindex on the same page?
It backfires. If the page is blocked by robots.txt, Googlebot does not crawl it and therefore never sees the noindex tag. Google warns that combining crawling and indexing rules can cause some rules to counteract others.
Does Google support crawl-delay?
No. Google only supports the user-agent, allow, disallow and sitemap fields. Other fields, such as crawl-delay, are not supported.
What happens if robots.txt returns a 404?
Google treats 4xx errors, except 429, as if no valid robots.txt existed: it assumes there are no crawl restrictions. A 5xx server error, by contrast, first makes Google stop crawling the site for 12 hours.
How long does Google take to pick up a change?
Google generally caches robots.txt contents for up to 24 hours, sometimes longer when refreshing is not possible, for example on 5xx errors. The lifetime can vary with the Cache-Control max-age header.
Is a robots.txt in a subfolder valid?
No. The file must sit at the top-level directory of the host. Crawlers do not check for robots.txt files in subdirectories, and a file only applies to the host, protocol and port where it is hosted.
Sources and scope
Documentation accessed October 14, 2026. This article relies on Google's public guidance; it presents no client case and no measured gain.
About the author

Franck Gordi
Independent SEO and GEO consultant for B2B SaaS. He helps software companies become visible on Google and cited by AI engines.
LinkedIn →