How matching works
- A crawler obeys only the most specific
User-agentgroup that names it. If GPTBot has its own group, the*rules do not apply to it. - Within that group the longest matching
AlloworDisallowpath wins.*matches any characters,$anchors the end of the URL. - robots.txt controls crawling, not indexing. A blocked URL can still be indexed from links, without its content. To keep a page out of Google, allow crawling and use
noindex; the noindex checker tests that.
robots.txt explained, line by line
| Line | What it does |
|---|---|
# ... | A comment. Everything after # is ignored. |
User-agent: * | Starts a group for every crawler that has no group of its own. |
Disallow: /cart/ | Blocks every URL whose path starts with /cart/. Paths are case-sensitive: /Cart/ is not blocked. |
Disallow: /*?sort= | * matches any characters, so this blocks any URL with ?sort= in it. |
Allow: /cart/help | Longer than /cart/, so it wins for /cart/help. |
User-agent: GPTBot + Disallow: / | GPTBot gets its own group, blocked from everything, and ignores the * group. |
Sitemap: ... | A full sitemap URL. It belongs to no group and applies to all crawlers. |
The rules around the file, from Google's robots.txt docs:
- It must sit in the top-level directory:
https://example.com/robots.txt. It covers only that protocol, host and port, sohttp://,www.and other subdomains each need their own. - Plain text, UTF-8. Google reads up to 500 KiB and ignores the rest.
- Google supports four fields:
user-agent,allow,disallowandsitemap. Field names are case-insensitive, values are not. - Invalid lines are ignored without warning. A typo doesn't break the file, it quietly drops a rule.
That last point is what a robots.txt validator is for. The syntax notes above flag lines without a colon, misspelled or unknown fields, rules before any User-agent, paths that don't start with / or *, and files over 500 KiB.
robots.txt wildcards: * and $
Google, Bing and the other big search engines support two wildcards in Allow and Disallow paths, and nothing more: no regular expressions, no character ranges. * matches any run of characters, including none and including /. $ at the end of a rule means the URL must end there. Every row below was run through Google's own parser and through this tester, with the same result.
| Rule | Blocks | Does not block |
|---|---|---|
Disallow: /fish | /fish, /fish.html, /fishheads, /fish/salmon.html | /Fish.asp, /catfish, /?id=fish |
Disallow: /fish* | The same as /fish. A * at the end adds nothing. | /catfish |
Disallow: /fish/ | /fish/, /fish/salmon | /fish, /fish.html |
Disallow: /*.php | /index.php, /folder/a.php?x=1, /a.php5 | /windows.PHP |
Disallow: /*.php$ | /a.php, /folder/a.php | /a.php?x=1, /a.php/, /a.php5 |
Disallow: /*? | Every URL with a query string: /shop?page=2 | /shop |
Disallow: /*?*sort= | /shop?sort=asc, /shop?page=2&sort=asc | /shop/sort=x |
Disallow: /$ | Only the home page / | /page, /?x=1 |
Disallow: /*/private/ | /a/private/x, /a/b/private/ | /private/x: the /*/ needs a folder in front |
Wildcard rules follow the same longest-match rule as any other: the longest matching path wins, counted in characters including the *. That gives two results people don't expect:
Allow: /page+Disallow: /*.htmlblocks/page.html./*.htmlis 7 characters,/pageis 5.Disallow: /*.pdf$+Allow: /downloads/lets/downloads/a.pdfthrough, because the Allow is longer. Without it, every PDF on the site is blocked.
Paths are case-sensitive and matched as written: Disallow: /page[0-9] blocks only a URL that literally contains [0-9], not /page1. And the reverse of Disallow: /$: Disallow: / + Allow: /$ leaves only the home page crawlable. Paste your rules above with the URLs you care about to see which one wins.
Google's robots.txt Tester is gone: what to use now
Google retired the robots.txt Tester in Search Console in November 2023 and replaced it with the robots.txt report, under Settings. The report does not test URLs. It shows:
- the robots.txt files Google found for the top 20 hosts of your property, with fetch status, when Google last checked each one and how many parsing issues it has;
- Request a recrawl in each file's menu, for after you fix a rule.
The report only exists for Domain properties and for URL-prefix properties without a path. To check a single URL, Google points to URL Inspection, one URL at a time. This tester takes up to 25 URLs at once, works on a file you paste before you publish it, and shows the rule that decided each URL for Googlebot, Bingbot and six AI crawlers.
Does this tester read robots.txt the way Google does?
For Googlebot, yes. Google open-sourced the C++ parser its production crawlers use (google/robotstxt on GitHub). We built it on our server and ran it side by side with this tester on the live robots.txt files of 25 large sites, among them Google, Amazon, Wikipedia, LinkedIn and Etsy, with each site's own rules plus near-miss URLs, for six user agents: 23,172 checks, 0 disagreements.
The cases where simpler testers go wrong, and what Google's parser does with them:
User-agent: Googlebot/2.1still counts as a Googlebot group. Only the part before the slash is matched.%2Fis not the same as/.Disallow: /a%2Fbblocks/a%2Fbbut not/a/b.- A
Crawl-delayorSitemapline between twoUser-agentlines does not split them into two groups. - A robots.txt that answers 429 or 5xx makes Google treat the whole site as disallowed while it lasts. A 404 or other 4xx means everything is allowed.
What no outside tester can show is the copy Google has cached. If you just changed the file, check the fetch time in the Search Console robots.txt report and request a recrawl there.
Crawl-delay in robots.txt
Crawl-delay is not part of the robots.txt standard, and the big search engines treat it differently:
| Crawler | Reads Crawl-delay? | Source |
|---|---|---|
| Googlebot | No. Google supports only user-agent, allow, disallow and sitemap, and says other fields such as crawl-delay aren't supported. | Google's robots.txt docs |
| Bingbot | Yes. The value is a time window of 1 to 30 seconds, and Bingbot fetches at most one page per window. It also overrides the crawl settings in Bing Webmaster Tools. | Bing Webmaster blog, 2012 |
| YandexBot | No, since 22 February 2018. Use the crawl speed setting in Yandex Webmaster. | Yandex Webmaster help |
For Bing the arithmetic is simple: Crawl-delay: 10 allows at most 8,640 pages a day (86,400 seconds / 10), Crawl-delay: 1 at most 86,400. On a site with more pages than that, Bingbot cannot fetch them all in one day. When a test above meets a Crawl-delay line, it notes that Googlebot ignores it.
Noindex in robots.txt does nothing
Google never documented a Noindex: line in robots.txt, and since 1 September 2019 its crawlers ignore it. Google's announcement says such lines were "contradicted by other rules in all but 0.001% of all robots.txt files" (Search Central blog, 2 July 2019). The same goes for Nofollow:. If you paste a file with these lines above, the tester marks them as unknown fields that Google ignores.
What to use instead, from the same announcement:
| Goal | Use | Watch out for |
|---|---|---|
| Keep a live page out of Google | noindex in a robots meta tag or an X-Robots-Tag header | Google must be allowed to crawl the page, or it never sees the noindex. Remove any Disallow for it. |
| A page that is gone | 404 or 410 | The URL drops out once Google recrawls it. |
| Staging or private pages | Password or login | Generally removes the pages from the index. |
| Stop crawling | Disallow | Blocks crawling, not indexing. Google can still list the URL from links, without a snippet. |
| Hide a URL fast | Removals tool in Search Console | Temporary. Pair it with one of the fixes above. |
The common mistake after 2019 is moving the noindex to the page and keeping the old Disallow: the page stays indexed because Google can't read the tag. Check one URL against both with the noindex checker.
robots.txt not found, unreachable or not updating
What Google does depends on the status code its crawler gets for /robots.txt (Google's robots.txt docs, updated 31 August 2026):
| robots.txt answers | What Google does |
|---|---|
| 404, 410 or another 4xx (not 429) | Crawls as if there were no robots.txt: nothing is blocked. A missing file is harmless. |
| 3xx | Follows at least five hops. If it still has no file, it treats the result as a 404. |
| 5xx, timeout, DNS or connection error | Stops crawling the whole site for the first 12 hours. Then uses the last cached copy for up to 30 days (no copy: no restrictions). After 30 days it acts as if there is no file, if the rest of the site is reachable. |
So "robots.txt not found" is only a problem when the 404 replaced rules you wanted. A robots.txt that times out or returns 503 is the one that stops Googlebot.
WordPress robots.txt not found. WordPress has no file on disk. It answers /robots.txt through a rewrite rule, and WordPress core (class-wp-rewrite.php) only adds that rule when two things are true:
- Permalinks are not set to Plain. With Plain, WordPress builds no rewrite rules at all, so the request never reaches WordPress and the server answers 404.
- WordPress is installed at the root of the host. A site at
example.com/blog/gets no virtual robots.txt, and crawlers only read the one atexample.com/robots.txtanyway.
A real robots.txt file in the web root wins over the virtual one, which is also why edits in an SEO plugin sometimes seem to do nothing: an old physical file is being served instead.
robots.txt not updating in Google. Google generally caches robots.txt for up to 24 hours, longer if it can't fetch a fresh copy, and a Cache-Control: max-age header can make that shorter or longer. Test the live file above to confirm the server (and any CDN in front of it) returns the new version, then use Request a recrawl in the Search Console robots.txt report.
Search Console says Indexed, though blocked by robots.txt? Read what it means and which fix fits.
Search Console says Blocked by robots.txt for pages that should rank? Read how to find the rule and fix it.
Pasted text is tested in memory and not stored. Live files are fetched once as NoindexWatchBot.