What this robots.txt validator checks
A robots.txt file tells crawlers which URLs on a host they may request. It sits at the top level of the host (https://example.com/robots.txt), must be plain text in UTF-8, and is made of groups: one or more User-agent lines followed by Allow and Disallow rules.
- Syntax: lines without a colon, unknown directives (such as a typo like
Disalow), rules before any User-agent and paths that do not start with/or*. - Logic: a
Disallow: /that blocks the whole site, the same user agent in several groups, noUser-agent: *group and no Sitemap line. - Rules Google ignores: Crawl-delay and noindex.
- Fetch checks: HTTP status, redirects, file size against 500 KiB and HTML served in place of a text file.
Robots.txt controls crawling, not indexing. A blocked URL can still appear in Google if other pages link to it. To keep a page out of search results, allow crawling and use a noindex robots meta tag or X-Robots-Tag header.
Which rule wins: how Google matches Allow and Disallow
Google first picks the group for the crawler: the group with the most specific matching user agent, or * if none matches. Groups for the same user agent are combined. Then, of the rules in that group that match the URL path, the longest one wins. If an Allow and a Disallow rule are equally long, Allow wins. The URL tester above follows these rules.
| URL | Rules | Result |
|---|---|---|
| /page | allow: /p · disallow: / | Allowed: /p is longer than / |
| /folder/page | allow: /folder · disallow: /folder | Allowed: equal length, so Allow wins |
| /page.htm | allow: /page · disallow: /*.htm | Blocked: /*.htm is longer |
| / | allow: /$ · disallow: / | Allowed: /$ matches only the home page |
| /page.htm | allow: /$ · disallow: / | Blocked |
HTTP status codes and what Google does
| robots.txt response | What Google does |
|---|---|
| 2xx (success) | Reads and follows the file. |
| 3xx (redirect) | Follows at least five redirect hops, then treats it as a 404. |
| 4xx except 429 | Acts as if there is no robots.txt: no crawl restrictions. |
| 429 or 5xx | Treats the site as fully disallowed and stops crawling for 12 hours, retrying robots.txt. A long outage falls back to the last cached copy. |
A common mistake is a robots.txt URL that returns your site's HTML page with status 200. Crawlers find no valid rules in it. The fetch mode flags this.
Common robots.txt errors
Disallow: /left over from a staging site, which blocks the whole live site.- Blocking CSS or JavaScript files that Google needs to render your pages.
- Expecting
Disallowto remove a page from Google. Use noindex instead, and do not block that page. - Writing paths without a leading slash, or with the wrong case:
/Blog/does not match/blog/. - A relative Sitemap URL. Use the full URL:
Sitemap: https://example.com/sitemap.xml.
Blocking AI crawlers with robots.txt
AI companies publish their own user agent tokens. List each one in a group to allow or block it. Check each vendor's documentation, because tokens change.
| User agent | Company | What it controls |
|---|---|---|
| GPTBot | OpenAI | Crawling for training OpenAI models |
| ClaudeBot | Anthropic | Crawling for training Claude models |
| PerplexityBot | Perplexity | Crawling to index pages for Perplexity answers |
| Google-Extended | Use of your content for Gemini training and grounding. It does not affect Google Search. | |
| CCBot | Common Crawl | The open web crawl many models are trained on |
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: PerplexityBot
User-agent: Google-Extended
Disallow: /Robots.txt is a request, not access control. Well-behaved crawlers follow it; others may not. Blocking AI crawlers can also make your brand less likely to appear in AI answers.
Testing robots.txt in Google Search Console
Google retired its old robots.txt Tester. Search Console now has a robots.txt report that shows the files Google found for the top 20 hosts of a property, when they were last fetched, their status and any parsing warnings, with an option to request a recrawl after a change. To check a single URL, use the URL Inspection tool.
Use this validator before you deploy a change, then confirm in Search Console after Google fetches the new file.

