What robots.txt does
robots.txt is a plain-text file at the root of a site, such as https://example.com/robots.txt, that tells crawlers which URLs of that host they may fetch. It covers only the host, protocol and port that serve it: https://shop.example.com/ needs a file of its own. Crawlers that follow the standard, RFC 9309 (opens in a new tab), read it before they crawl. It is a request, not access control: anyone can still open the pages, so it is no way to hide private content.
robots.txt also controls crawling, not indexing. Google can list a URL it may not crawl, without a description, when other pages link to it. To keep a page out of search, let crawlers fetch it and add a noindex robots meta tag or X-Robots-Tag header.
How to test a robots.txt file
- Paste your robots.txt, open the file, or start from a template.
- Fix the lines the editor marks: crawlers skip a line with an error and read the rest.
- Enter a path or a full URL, and choose a crawler or type another user agent.
- Read the verdict: whether the crawler may fetch the URL, which line decides and which group it follows. Show the rule selects that line.
- Download the file as robots.txt and upload it to the root of your site.
Examples
Input
User-agent: *
Disallow: /admin/
Allow: /admin/public/
Output
Googlebot /admin/public/a Allowed Allow: /admin/public/ (line 3)
Googlebot /admin/x Blocked Disallow: /admin/ (line 2)
Googlebot / Allowed no rule matches
Input
User-agent: *
Disallow: /*.pdf$
Output
Googlebot /files/a.pdf Blocked Disallow: /*.pdf$ (line 2)
Googlebot /files/a.pdf?dl=1 Allowed no rule matches
Input
User-agent: *
Disallow: /
User-agent: Googlebot
Allow: /
Output
Googlebot /page Allowed Allow: / (line 5)
GPTBot /page Blocked Disallow: / (line 2)
Line 2, column 1: Disallow: / in the * group blocks the whole site for every crawler without a group of its own. That's right for a staging site; on a live site it keeps pages out of search. (ROBOTS_BLOCK_ALL)
How a crawler picks its group and its rule
- Groups. A group starts with one or more
User-agentlines, and theAllowandDisallowlines after them belong to it, up to the nextUser-agentline. Blank lines, comments and sitemaps don't end a group. - The crawler's group. A crawler looks for the groups that name its product token, the name before any version:
Googlebot/2.1isgooglebot, in any case. Groups that name the same crawler are read as one. - The * group. A crawler without a group of its own follows the
*group; with no*group either, nothing is blocked. It never adds the*group's rules to its own. - Documented exceptions. Google's AdsBot and Mediapartners-Google ignore the
*group, and Applebot follows Googlebot's group when no group names Applebot. - The deciding rule. Within the group, the rule with the longest path decides, counted in characters with any
*and$. When anAllowand aDisalloware equally long, theAllowwins. With no matching rule the URL is allowed, and/robots.txtitself always is.
Wildcards, the end of a path, and encoding
- A rule matches the start of the URL's path and query:
Disallow: /fishblocks/fish,/fish.htmland/fish/salmon?size=2, but not/Fish, since paths are case-sensitive. *stands for any run of characters, slashes included:Disallow: /*.pdfblocks PDF files in every folder.$at the end means the path ends there:Disallow: /*.pdf$blocks/a.pdfbut not/a.pdf?dl=1. A*at the end adds nothing.- Rules and URLs are compared percent-encoded:
/üand/%C3%BCare the same path, and so are/%7Eaand/~a, while%2Fstays different from/. To match a*or$that is part of a URL, write%2Aor%24. - The host and the part after
#are never compared.
Directives only some crawlers read
Google reads four directives: user-agent, allow, disallow and sitemap. A sitemap line takes the sitemap's full URL, may appear anywhere and as often as needed, and belongs to no group. Other directives depend on the crawler:
Crawl-delayasks a crawler to wait between requests. Google ignores it, Anthropic's crawlers honor it, and Applebot doesn't.Hostnamed a site's main mirror for Yandex; Yandex's robots.txt guide no longer lists it.Clean-paramtells Yandex which URL parameters, such as UTM tags, to ignore when indexing.Noindexisn't supported in robots.txt. Use the robots meta tag or theX-Robots-Tagheader.
AI crawlers and training controls
AI companies document separate crawlers for training, for their search features and for pages a user asks for, and some publish a token that only controls how crawled pages may be used. As their operators describe them in November 2026:
| Token | Operator | What it does |
|---|---|---|
Google-Extended | Whether content may train and ground Gemini and Vertex AI; no effect on Search. A control token: no crawler sends it. | |
GPTBot | OpenAI | Training OpenAI's models. |
OAI-SearchBot | OpenAI | ChatGPT search results. |
ChatGPT-User | OpenAI | Pages ChatGPT users ask for. OpenAI says robots.txt rules may not apply to these user-initiated fetches. |
ClaudeBot | Anthropic | Training Anthropic's models. |
Claude-SearchBot | Anthropic | Claude's search results. |
Claude-User | Anthropic | Pages Claude users ask for. |
PerplexityBot | Perplexity | Perplexity's search results; not used for training. |
Perplexity-User | Perplexity | Pages Perplexity users ask for. Perplexity says this fetcher generally ignores robots.txt. |
Applebot-Extended | Apple | Whether content may train Apple's generative models. A control token: no crawler sends it. |
Blocking a training token doesn't change search: Google says Google-Extended has no effect on Google Search, and Apple says it doesn't use Applebot-Extended rules for ranking. Fetches a user asks for may not follow robots.txt, as OpenAI and Perplexity say of theirs.
Common errors and fixes
| Code | What it means | How to fix it |
|---|---|---|
ROBOTS_Error | A line has no colon after its name, like Disallow /private/. The standard says to skip it, though Google's parser reads it as if the colon were there. | Write a name, a colon and a value: Disallow: /private/. |
ROBOTS_Error | An Allow or Disallow line comes before the first User-agent line, so it belongs to no group. | Put a User-agent line above it, such as User-agent: *. |
ROBOTS_Error | A User-agent line has no value. | Name a crawler, or write * for every crawler without a group of its own. |
ROBOTS_Warning | A line's name isn't a robots.txt directive, often a typo such as Dissallow. | Use the directive the problem suggests, or remove the line. |
ROBOTS_Note | Crawl-delay, Host, Clean-param or Noindex: directives Google doesn't read and other crawlers read differently. | Keep it only for the crawlers that read it; the note says which. |
ROBOTS_Warning | A Sitemap line has a path, such as /sitemap.xml, instead of a full URL. | Write the sitemap's full address, with https:// and the host. |
ROBOTS_Warning | A rule's pattern doesn't start with / or *, so it can't match a URL's path. | Start the pattern with /. |
ROBOTS_Warning | Disallow: / in the * group blocks the whole site for every crawler without a group of its own. | Keep it for a staging site only. |
ROBOTS_Note | Two groups name the same crawler, so crawlers read their rules as one group. | Keep one group per crawler. |
ROBOTS_Note | The file has no User-agent lines, so every crawler may fetch everything. | Add a group, such as User-agent: * with the rules you want. |
ROBOTS_Warning | The file is larger than the 500 KB Google reads; it ignores the rest. | Shorten it: remove old rules, or cover paths with * patterns. |
ROBOTS_Error | The URL to test isn't a path starting with / or a full http:// or https:// URL. | Enter a path such as /blog/, or a full URL. |
INPUT_Error | The file is longer than the 2 MB this tool checks. | Check a smaller file, or the part you changed. |