A robots.txt file understands only four fields: user-agent, allow, disallow and sitemap. Google’s parser silently skips every other line. In the second episode of the “Non-Canonical Cabinet” series, Gary Illyes and Cherry Prommawin of Google went through what actually works in this file and what only looks like it does. For me, three things from the conversation matter most: emoji and non-ASCII characters in paths are best written percent-encoded, you block an AI crawler with its real token, and robots.txt has no say in what a company does with content it has already fetched.
Barry Schwartz covered the episode on Search Engine Roundtable (October 21, 2026). Below I set what was said in the conversation against Google’s documentation and the RFC 9309 standard. I also added the things the episode didn’t cover and that break most often in audits: which group of rules a bot picks, how allow and disallow are ranked, and what Google does when it can’t fetch the file.
What Google said about robots.txt
Illyes described robots.txt as a plain text file in the site’s root directory, where the owner tells automated clients where they may go. The rules are read by search engine crawlers, bots collecting data to train AI models and any other robots that follow the rules at all. Googlebot (and every other “well-behaved” robot) checks this file before fetching anything else.
The basis is the RFC 9309 standard, which Google says it follows. The parser reads the file line by line and looks for four fields: user-agent, allow, disallow, sitemap. A line it doesn’t understand is discarded, and it moves on to the next one.
Schwartz summed the episode up in three sentences: Googlebot and other compliant crawlers use robots.txt to limit crawling, the file should follow RFC 9309, and emoji and non-ASCII characters in rule paths are worth percent-encoding so that every crawler understands them.
Four fields and silently discarded lines
If you write something like “don’t crawl the secret page” in the file, the parser won’t report an error. It will treat the line as invalid and skip it, and the page will remain accessible to the robot. As Illyes put it, a rule that makes sense to a human doesn’t necessarily work for a machine.
Google’s documentation adds a few details I find useful in audits:
- field names are case-insensitive, paths are not (
Disallow: /Cart/won’t block/cart/), - a path must start with
/, and anallowordisallowrule without a path is ignored, - fields other than
allow,disallowanduser-agent(e.g.sitemap) don’t end a group of rules, so asitemapline placed between twouser-agentlines doesn’t separate them, - the
sitemapfield takes a full URL, belongs to no group and may point to another host, - the file must be UTF-8 text, and Google processes up to 500 KiB of it and ignores anything beyond that,
- a BOM at the start of the file is skipped, and line endings can be CR, CR/LF or LF,
- if the server returns an HTML page at
/robots.txt, Google extracts the lines that look like rules and ignores the rest.
Comments are allowed: the crawler ignores everything from the # character to the end of the line, so ASCII art in comments won’t break anything (although Illyes called it a questionable idea). Prommawin mentioned a robots.txt file that was 97% decoration and only 3% directives. The parser will cope with that, but the robot downloads unnecessary bytes, and decorations placed next to important directives are easy to damage while editing, so it’s better to keep them away from each other.
Fields that only look like they work
In client files I regularly see lines copied from old tutorials. Google’s parser treats them exactly like the sentence “don’t crawl the secret page”: it skips them.
| Line in the file | What to do with it | |
|---|---|---|
Crawl-delay: 10 | Ignores it. | Bing respects it (a window of 1 to 30 seconds), and Anthropic says its bots support it. Keep it if it’s aimed at them. |
Noindex: /page/ | Ignores it. Google retired the code handling this field on September 1, 2019. | Use noindex in the robots meta tag or the X-Robots-Tag header. |
Nofollow: /directory/ | Ignores it, since the same date. | The rel="nofollow" attribute on links, or the robots meta tag. |
Clean-param: utm_source | Ignores it. This is a Yandex field. | In Google, parameters are handled with canonical URLs and consistent internal linking. |
| A sentence in plain language | Ignores it. | Delete it or turn it into a comment with #. |
RFC 9309 lets crawlers support extra fields of their own (that’s how sitemap works), as long as this doesn’t interfere with reading the standard ones. That’s why the same file can mean one thing to Google and another to Bing.
I cover the syntax from scratch in my complete guide to robots.txt.
Which group of rules applies to a given bot
The episode didn’t cover this, and it’s the most common mistake I see in files with rules for AI crawlers. A crawler applies only one group of rules: the one whose user-agent matches its name most specifically. It falls back to the * group only when it finds no group of its own, and according to Google’s documentation it doesn’t merge the * rules with those of the specific group. The order of groups in the file doesn’t matter.
Take this file:
User-agent: *
Disallow: /cart/
Disallow: /search/
Someone adds a block on the blog for OpenAI’s bot at the end:
User-agent: *
Disallow: /cart/
Disallow: /search/
User-agent: GPTBot
Disallow: /blog/
From now on GPTBot applies only its own group. The blog is blocked for it, but /cart/ and /search/ have just been opened, because the rules in the * group no longer apply to it. Googlebot behaves the same way when it gets its own group, and Bing has described the same rule for a bingbot section.
So the shared rules have to be repeated in the specific group:
User-agent: *
Disallow: /cart/
Disallow: /search/
User-agent: GPTBot
Disallow: /cart/
Disallow: /search/
Disallow: /blog/
A few related details from Google’s documentation:
- if the file has two groups for the same bot, Google merges them into one,
- several
user-agentlines in a row form one group shared by the bots listed, - the bot name in
user-agentis case-insensitive, - anything after the name is ignored, so
googlebot/1.2andgooglebot*mean the same asgooglebot.
Allow versus disallow: the longer path wins
The parser won’t flag conflicting rules as an error either. The order they are written in doesn’t matter: for a given URL, Google picks the rule with the longest matching path (RFC 9309 measures length in octets), and on a tie the less restrictive one, which is allow.
Examples from Google’s documentation:
| URL | Rules | Result | Why |
|---|---|---|---|
/page | allow: /p and disallow: / | allowed | /p is longer than / |
/folder/page | allow: /folder and disallow: /folder | allowed | a tie, allow wins |
/page.htm | allow: /page and disallow: /*.htm | blocked | /*.htm is longer than /page |
/page.php5 | allow: /page and disallow: /*.ph | allowed | a tie, allow wins |
/ | allow: /$ and disallow: / | allowed | /$ is longer and matches only the home page |
/page.htm | allow: /$ and disallow: / | blocked | /$ doesn’t match, so disallow: / applies |
Two special characters work in paths:
*stands for any sequence of characters, including none. A trailing asterisk changes nothing, because every rule already covers all URLs that start with its path.$marks the end of the URL.
One example shows the difference:
User-agent: *
# Also blocks /pricing.php?version=2 and /file.php5
Disallow: /*.php
# Blocks only URLs that end in .php
Disallow: /*.php$
The trailing slash works the same way: Disallow: /fish covers /fish, /fish.html, /fishing/ and /fish/salmon.html, while Disallow: /fish/ covers only what sits inside the /fish/ directory. A missing trailing slash is a common reason a block turns out wider than intended.
Emoji and non-ASCII characters: tokens versus paths
The emoji thread started as a joke (someone asked whether you can write a user-agent with a chicken in it), but it leads to a concrete rule, separate for tokens and for paths.
Crawler token: simple characters only
Emoji and letters outside the basic set won’t work in the user-agent field. According to Illyes, a token can consist only of letters and hyphens. RFC 9309 is slightly broader here and allows the letters a-z and A-Z, the underscore and the hyphen. The conclusion doesn’t change: an emoji is a multi-byte UTF-8 character that doesn’t fit that set, so a rule using one won’t work.
The underscore matters in practice. The token Google plans to support from 2027 for a shared AI training preference is written __usage_ai-training. I described it in my article on shared AI training control in robots.txt.
Paths: use percent-encoding
In allow and disallow paths, non-ASCII characters are needed, because real URLs contain them: accented letters, German umlauts, Cyrillic, Chinese characters, emoji.
Google handles raw UTF-8. According to the documentation, it matches rules against percent-encoded URLs and converts raw characters in a rule to that form itself. Prommawin pointed out, however, that other or older crawlers may trip over this: if they can’t process a raw character, they will skip the whole disallow line and go exactly where you wanted to stop them. That’s why it’s best to write the rule the way the server sees it, in encoded form.
An example for a /münchen/ directory:
User-agent: *
# Instead of: Disallow: /münchen/
Disallow: /m%C3%BCnchen/
You would write the 🐔 emoji in a path the same way, as %F0%9F%90%94. RFC 9309 requires non-ASCII characters to be percent-encoded before matching anyway.
You don’t have to work out the encoded form by hand. The browser console does it:
encodeURI('/münchen/')
// "/m%C3%BCnchen/"
I then check the result against the server, because what counts is what actually ends up in the request:
curl -I "https://example.com/m%C3%BCnchen/"
Accented characters in slugs are not that common, but they do show up in older online stores and classifieds sites. If you block such sections, check how the rule is written and test it against real URLs, because rules for URLs with special characters are usually something nobody has ever tested.
AI crawlers: a token, not a decorative rule
Illyes spent the most time on generative AI. He stressed that under RFC 9309, robots.txt is an access preference protocol: it tells a bot whether it may come in, and that is where its role ends. What a system does with the data it has fetched is not something the file governs.
To block a specific AI crawler, you need to put its recognised name in user-agent. A rule like “don’t use my content for training” is garbage to the parser and gets dropped during parsing. Tokens change and new ones keep appearing, so check the current list in the documentation of the operator of a given bot.
The conversation didn’t include a list, so I checked the documentation of three operators for the tokens they publish today (as of November 14, 2026):
| Operator | Token | What it’s for |
|---|---|---|
| OpenAI | GPTBot | Collects content that may be used to train models. |
| OpenAI | OAI-SearchBot | Indexes pages for search in ChatGPT. |
| OpenAI | ChatGPT-User | Fetches a page at a user’s request. OpenAI notes that robots.txt rules may not apply to it. |
| Anthropic | ClaudeBot | Collects content that may be used to train models. |
| Anthropic | Claude-SearchBot | Indexes pages for search in Claude. |
| Anthropic | Claude-User | Fetches a page when a user asks a question. |
Google-Extended | Controls use of content for Gemini training and grounding. It is not a separate crawler. |
The table shows two kinds of bots. Blocking a training bot (GPTBot, ClaudeBot) doesn’t cost you visibility in answers, while blocking a search bot (OAI-SearchBot, Claude-SearchBot) does. If you only want to opt out of training, the file can look like this:
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
Disallow: /
User-agent: *
Disallow: /cart/
Disallow: /search/
Three user-agent lines in a row form one group. There’s no need to repeat the * rules here, because Disallow: / covers everything anyway.
Google-Extended works differently from the rest. Publishers use it to control whether their content is used to train future Gemini models and for grounding (feeding the model content from the search index at prompt time). According to Google, this token doesn’t have a separate user agent in HTTP requests and works only in robots.txt, while crawling itself still happens under Google’s existing names. So you won’t see it in server logs. The documentation also notes that it doesn’t affect a page’s inclusion in Search or its ranking.
It’s also worth separating crawl control from content-use policy. Robots.txt can block access to a page, but it won’t stop a company from training models on content it already has. For that you need licence terms, contracts or regulation, which are tools outside this file.
I discuss the split between search engine bots and AI bots in more detail in AI crawlers vs search crawlers, and which bots you’d better not block if you care about citations in ChatGPT or Perplexity in my article on making your website visible to LLMs.
When Google can’t fetch the file
Correct rules aren’t enough if the server answers the /robots.txt request badly. The HTTP status decides whether Google applies any rules at all.
| Response | What Google does |
|---|---|
| 2xx | Processes the file as served. |
| 3xx | Follows at least five redirects, then treats the file as a 404. It doesn’t follow JavaScript or meta refresh redirects. |
| 4xx except 429 | Behaves as if there were no file, so there are no restrictions. This includes 401 and 403. |
| 429 and 5xx | Treats it as a server error. For the first 12 hours it stops crawling the site and keeps retrying the file. For the next 30 days it uses the last good copy. With no copy, it crawls without restrictions. |
| DNS error, timeout, reset connection | Treats it as a server error. |
After 30 days of unresolved errors, Google checks whether the site itself responds. If it does, Google behaves as if there were no file. If it doesn’t, Google stops crawling the site and only requests robots.txt from time to time.
Two rows of this table come up most often in my audits:
- A 403 on robots.txt doesn’t block Google. A firewall or CDN that rejects bots with a 403 opens the whole site to Googlebot, including the sections that were meant to be off limits. When moving a site to a CDN, this URL is the first one I check.
- A 500 on robots.txt stops crawling of the whole site, even if every other page works fine. I described how to use this on purpose in my article on taking a site offline to patch PHP.
Then there is the cache. Google generally keeps the fetched copy for up to 24 hours, takes the Cache-Control: max-age header into account, and may keep it longer on errors and timeouts. So a change to robots.txt doesn’t take effect immediately. OpenAI gives a similar time for its systems, about 24 hours. If you are unblocking something urgent, you can request a recrawl of the file in the robots.txt report in Search Console.
The file also applies to one protocol, host and port only. https://example.com/robots.txt doesn’t cover https://shop.example.com/ or the http:// version, so every subdomain needs its own file.
Robots.txt is not security
Schwartz closed by reminding readers that robots.txt is a request to crawlers willing to follow it, not a security mechanism. It won’t stop an unauthorised client or a bot that ignores the file, and the standard itself states plainly that these rules are not a form of authorisation. Listing the path to a “secret” directory actually works the other way round, because it reveals its existence to anyone who opens /robots.txt.
Content is protected with authentication or with rules on the server or in a WAF. A page is kept out of the index with noindex or a response code, and disallow alone won’t do it: Google says in its documentation that a blocked URL can still appear in results (without a description), because it can be indexed without its content being crawled. For the same reason disallow and noindex on one page cancel each other out: Google won’t fetch the page, so it never sees the noindex. I write more about these differences in the robots.txt guide. What the file does affect is rendering: Google won’t fetch a blocked script, which John Mueller suggested as a way to hide a pop-up from Googlebot.
How to check that a rule works
The parser doesn’t report errors, so rules have to be tested. I use three methods.
The robots.txt report in Search Console. It’s in the settings of a Domain property. It shows the files found on up to 20 hosts, the fetch status, the date of the last check, the size and the number of syntax issues. An error in the report means the rule isn’t used, while a warning doesn’t disable it. The report won’t test a specific URL, though.
URL inspection in Google Search Console. This is where you see whether a specific URL is blocked by robots.txt.
Google’s parser, run locally. In the google/robotstxt repository Google publishes a C++ library it describes as the production code used by Googlebot. The robots_main tool takes a file, a bot name and a URL:
bazel run robots_main -- ~/robots.txt Googlebot https://example.com/cart/
# user-agent 'Googlebot' with URI 'https://example.com/cart/': DISALLOWED
It’s the quickest way to test a new file against a list of URLs before deploying it, including URLs with non-ASCII characters. The result applies to Google, not to every crawler.
What to do with this
A short checklist:
- Validate the syntax and test rules against specific URLs. A readable rule doesn’t necessarily work.
- Remove lines the parser doesn’t recognise. Home-made “directives”,
noindexand notes do nothing. - Check the
user-agentgroups. Every bot with its own group needs the full set of rules in it, because it no longer uses the*group. - Review
allowanddisallowpairs. The longer path wins, not the order in the file. - Percent-encode paths with non-ASCII characters and emoji if the rules are meant to work outside Google too.
- Use the real tokens of AI crawlers and tell training bots apart from search bots.
- Don’t treat robots.txt as protection or as a way to withdraw data a company has already fetched.
- Watch the server response: a 200 status, UTF-8, under 500 KiB, a separate file on every subdomain. A 403 opens the site, and a 5xx stops crawling.
Limitations and unknowns
The episode covers existing rules, and Google didn’t announce any change to how it handles robots.txt. One caveat runs through the whole conversation: what Google supports, Bing, DuckDuckGo or the AI crawlers of various companies don’t necessarily support. Each operator can read the file its own way, and some bots don’t respect it at all.
The same goes for what I added from the documentation. The 12-hour and 30-day thresholds, the 500 KiB limit and the way groups are merged describe Google’s behaviour. RFC 9309 leaves crawlers a lot of room here: on a server error it tells them to assume a complete disallow, but not how long to keep it. The AI token table reflects the day this article was updated, so check it with the operators before you use it.
Summary
Robots.txt has a simple syntax, which makes it easy to make a mistake nobody notices: it understands four fields, discards the rest without warning, gives each bot a single group of rules and settles conflicts between allow and disallow by path length. It accepts only simple characters in tokens, and paths are safest when percent-encoded. You stop an AI crawler with the right token, keeping in mind that the file governs access, not later use of the content. If your file contains something “for decoration” or “just in case”, remove it and check which rules actually work.
Frequently Asked Questions
Which rules does robots.txt support in Google?
Google supports four fields: user-agent, allow, disallow and sitemap. It ignores other lines, including crawl-delay and noindex (retired on September 1, 2019). Field names are case-insensitive, paths are not.
Which rule wins when allow and disallow match the same URL?
The one with the longer matching path, whatever the order in the file. When the paths are equally long, Google picks the less restrictive rule, which is allow. That’s why allow: /p beats disallow: / for the URL /page.
Do the User-agent: * rules apply to a bot that has its own group?
No. A crawler picks the single best-matching group and uses the * group only when it has none of its own. If you add a group for GPTBot or Googlebot, repeat in it every rule that should still apply to that bot.
Can I use emoji and non-ASCII characters in robots.txt?
In rule paths, yes, but it’s safest to write them percent-encoded (e.g. /münchen/ as /m%C3%BCnchen/). Google handles raw UTF-8, but other or older crawlers may skip such a line. In the user-agent token, emoji and characters outside the basic set won’t work at all.
What happens when robots.txt returns a 403 or a 500?
Google treats 4xx codes (except 429) as if there were no file, so with a 403 it crawls the site without restrictions. With 5xx and 429 it stops crawling for 12 hours, then uses the last good copy of the file for the next 30 days.
How long does it take Google to notice a change in robots.txt?
Usually up to 24 hours, because that’s how long Google keeps a cached copy of the file. The Cache-Control: max-age header can change that time, and server errors can extend it. You can request a recrawl of the file in the robots.txt report in Search Console.
Will robots.txt stop AI models from being trained on my content?
Only partly. The file tells a crawler whether it may access a page, but it doesn’t decide what a company does with data it fetched earlier. To block a training bot, put its correct token (e.g. GPTBot, ClaudeBot, Google-Extended) in the user-agent field and check it in the operator’s documentation.
Does robots.txt protect private pages from access?
No. The file is a request to crawlers that follow it, and any path listed in it is publicly visible. Content is protected with authentication or server-side rules.
Comments