Robots.txt Tester and Generator
Operator: Abdulla Al Fahad. How tools are built and checked
One Disallow line with a trailing slash in the wrong place, an Allow shorter than the Disallow beside it, or a rule written for the wrong crawler can hide a section from search or leave a private folder open, and a robots.txt is short enough that nobody reads it twice. Search Console's robots.txt report shows what Google fetched, and Google publishes its parser as open source, but neither lets you paste a draft and test a list of URLs against several crawlers.
This page takes the file as text, lets you list the URLs you care about and the crawlers you care about, and shows for each pair whether the URL is allowed, which rule decided it and on which line. It also lints the file for the mistakes that cause most real-world problems, and has a generator for building a clean file. It tests what you paste; it does not fetch live robots.txt files, because a browser is not allowed to read another site's file.
Key features
- Matching that follows RFC 9309 and Google's documentation: the most specific user-agent group is chosen, rules from several groups naming the same crawler are merged, the longest matching pattern wins and Allow wins a tie
- Wildcards: * matches any run of characters and a trailing $ anchors the end of the URL; matching is case-sensitive for paths and case-insensitive for user-agent names
- Percent-encoding normalised on both sides, so a rule for /caf%C3%A9 matches the same URL written with the accented letter
- Up to 5,000 URLs or paths per run, each shown with its verdict, deciding rule, line number and a plain-language reason
- Presets for Googlebot and its image, news, video and inspection variants, AdsBot, Bingbot, Yahoo, DuckDuckBot, Baidu, Yandex, Applebot and common AI crawlers such as GPTBot, ClaudeBot, PerplexityBot and CCBot
- A linter with 22 checks: rules before any User-agent line, lines with no colon, misspelled or unknown directives, Crawl-delay, noindex in robots.txt, relative Sitemap URLs, patterns that cannot match, blocked scripts and styles, a site-wide block, and a file over 500 KiB
- A generator with starting points for allow-all, block-all, WordPress and Next.js, extra Allow and Disallow paths, AI crawler blocks and Sitemap lines
How rules are matched, and what the checker flags
A robots.txt is a list of groups. A group starts with one or more User-agent lines and holds the Allow and Disallow rules that follow until the next User-agent line. A crawler obeys the one group whose name matches it best, comparing the product token without regard to case: Googlebot-Image uses a group named Googlebot-Image if there is one, otherwise the Googlebot group, otherwise the group for *. If several groups name the same crawler, their rules are combined as if they were one group. A crawler that matches no named group and finds no * group is allowed everywhere. AdsBot crawlers are the exception: they ignore the * group and obey only groups that name them.
Within the chosen group the rule with the longest matching pattern decides. Both the Allow and the Disallow rule that match are compared by the length of their pattern, after normalisation, and the longer one wins; when the lengths are equal, the less restrictive rule, Allow, wins. An empty Disallow matches nothing. Patterns are matched from the start of the URL path and query string, so a rule that does not begin with / or * cannot match anything, and the linter says so. The path /robots.txt itself is always fetchable.
Paths are case-sensitive: Disallow: /Private does not block /private. A $ means end of URL only at the very end of a pattern; elsewhere it is a literal dollar sign. A pattern without a trailing $ is a prefix match, so Disallow: /private blocks /private, /private/page and /private-notes alike, which surprises people who expected a folder. Both the pattern and the URL path are percent-normalised before comparison: escapes of unreserved characters are decoded, other escapes are upper-cased and non-ASCII characters are encoded as UTF-8.
The size limit matters. RFC 9309 says a crawler must parse at least 500 KiB, and Google ignores anything after that point. The tester stops reading at 500 KiB and reports it. Several directives are not part of the standard: Google ignores Crawl-delay (Bing reads it), Host was a Yandex-only extension, and noindex or nofollow in robots.txt has not been honoured by Google since 1 September 2019, so the linter marks the last as an error. To keep a page out of the index, use a robots meta tag or an X-Robots-Tag header and leave the page crawlable so the crawler can read the instruction.
How it works
The file is parsed once into lines, groups and rules, with line numbers kept. For each URL the page extracts the path and query, picks the groups for the chosen crawler, normalises the path, finds the best matching Allow and the best matching Disallow, and compares their lengths. The results table shows the rule that won and, when a rule of the opposite kind also matched and lost, the overridden rule, so you can see why a more specific Allow beat a broad Disallow. A URL on a different host from the one you set is flagged, since a robots.txt only governs its own host.
When to run it
- Checking before a release that a faceted-navigation Disallow blocks filtered URLs but not the category pages
- Confirming that CSS, JavaScript and image folders stay crawlable after tightening a wildcard rule
- Testing a migration list of old URLs against the new robots.txt for each major crawler
- Seeing which crawlers a block for GPTBot or CCBot actually stops, and which fall through to the * group
- Finding the stray line that makes a whole group of rules apply to nobody
Running a check
- Paste the robots.txt into the file box, or start from the generator and copy the result back.
- Choose one or more crawlers; Googlebot is selected by default.
- Paste the URLs or paths to test, one per line.
- Read the verdicts and the deciding line for each URL, then fix anything surprising in the lint report and test again.
Example
A small robots.txt
User-agent: *
Disallow: /search
Allow: /search/about
Disallow: /*?sort=
Disallow: /private$
Crawl-delay: 5
User-agent: GPTBot
Disallow: /Verdicts for Googlebot, and one for GPTBot
/search/about -> allowed (Allow: /search/about, 13 characters, beats Disallow: /search, 7)
/search/results -> blocked (line 2)
/shoes?sort=price -> blocked (line 4)
/private -> blocked (line 5, $ anchors the end)
/private/page -> allowed (nothing matches)
/Search -> allowed (paths are case-sensitive)
GPTBot /blog -> blocked (its own group, line 9)
Lint: Crawl-delay is ignored by Google; no Sitemap lineTips for best results
- Test the URLs that matter, not the pattern. Paste ten real addresses, including the ones that should stay open, and read the verdicts.
- When an Allow and a Disallow both match, compare their lengths. Making the Allow longer than the Disallow is the usual way to carve out an exception.
- Add a trailing $ to block one exact URL such as /private without blocking everything that begins with it.
- Give a crawler its own group only when you mean it. A group named GPTBot stops GPTBot from reading the * group at all, so repeat any rules that should still apply to it.
- Test Googlebot-Image and AdsBot-Google separately if you use them; they fall back differently from the main crawler.
Limits
Robots.txt is a request, not access control. Well-behaved crawlers follow it; it does not hide anything from people or from crawlers that ignore it, and a blocked URL can still be indexed from links without its content.
Blocking a page in robots.txt prevents crawlers from reading a noindex tag on that page. If you want it out of search results, allow crawling and use noindex.
This tester follows RFC 9309 and Google's documented behaviour. Other crawlers have their own quirks, such as reading Crawl-delay or treating wildcards differently, so a green result here is strong evidence for Google and Bing, not proof for every bot.
The page does not fetch your live file. If the deployed robots.txt differs from what you pasted, because of a CDN cache or a different environment, the results describe your paste.
Common errors and how to fix them
- "appears before any User-agent line"
- Move the line below a User-agent line. Rules above the first User-agent belong to no group and every crawler ignores them.
- "does not start with / or *"
- Write the pattern from the start of the path, for example Disallow: /admin/ instead of Disallow: admin/. A pattern that does not begin with a slash cannot match.
- "noindex in robots.txt has not been honoured by Google since 1 September 2019"
- Remove the line. Use a robots meta tag or an X-Robots-Tag HTTP header on the page, and make sure robots.txt does not block that page.
Blocking AI crawlers
Several AI companies publish a user-agent token for their crawlers, and each honours a robots.txt group that names it. The generator offers eleven of them to block with a Disallow: / group each, among them GPTBot, ClaudeBot, PerplexityBot, CCBot, Bytespider and Google-Extended, with a note on what each one does. Two cautions apply. Blocking is a request that only compliant crawlers follow, and some tokens control different things: Google-Extended, for example, governs use of content for AI training and is separate from Googlebot, which still crawls for search.
Choose carefully before blocking a search-related token. Blocking OAI-SearchBot or PerplexityBot can remove your pages from those products' search answers, while blocking a training crawler such as CCBot does not affect that. The tester shows exactly which crawlers a given file stops, so you can check the effect before publishing it.
Frequently asked questions
Why is /Search allowed when I disallowed /search?
Paths in robots.txt are case-sensitive, so /Search and /search are different. If your site treats them as the same page, add a rule for each spelling or fix the site to redirect one to the other.
Which rule wins when Allow and Disallow both match?
The one with the longer pattern. If the two patterns have the same length, the Allow wins, because Google and RFC 9309 prefer the less restrictive rule.
Can it fetch my robots.txt from a URL?
No. Browsers do not let a page read another site's files unless that site permits it, so you paste the content. You can copy it from your site with the address bar or curl.
Does Crawl-delay slow down Googlebot?
No, Google ignores it. Bing and some other crawlers read it. To slow Googlebot down temporarily, return 503 or 429 responses; the crawl-rate limiter in Search Console was retired in January 2024.