robots.txt Tester: Check if a URL Is Blocked (and Which Rule Blocks It)

A robots.txt file looks simple — a few Allow and Disallow lines — until one of them blocks a page you wanted in Google, or fails to block one you didn’t. Most robots.txt mistakes come from three rules almost nobody reads: how a crawler picks which group of rules applies to it, how it decides between an Allow and a Disallow that both match, and what the * and $ wildcards actually do.

Google retired the robots.txt Tester in Search Console in 2023, replacing it with a robots.txt report that shows how your file was fetched and parsed — but doesn’t test individual URLs. The tester below fills that gap: paste your file, enter URLs, pick a crawler, and see the decision and the rule behind it.

Quick answer

A crawler follows only the most specific User-agent group that names it — falling back to User-agent: * only if none does. Inside that group, the longest matching rule wins, and if an Allow and a Disallow are the same length, Allow wins. A URL that matches no rule is allowed.

robots.txt tester

Paste your robots.txt, add the URLs you want to check — one per line — and choose a crawler. The tester applies the same rules Google documents, and shows the group it used, the deciding rule for each URL, and any lines crawlers will ignore.

robots.txt tester

Paste your robots.txt, enter one or more URLs and pick a crawler. The tester shows whether each URL is allowed or blocked — and the exact rule that decides it. Everything runs in your browser.

Follows RFC 9309 and Google’s documented behavior: the most specific user-agent group applies, the longest matching rule wins, and Allow wins a tie. Tested against Protego, the parser that follows Google’s specification. Source: copahost.com

How a crawler picks its group

A robots.txt file is a set of groups, each starting with one or more User-agent lines followed by its rules. A crawler obeys exactly one group — never a mix:

  1. It looks for the group whose User-agent names it most specifically. Googlebot-Image picks a Googlebot-Image group if one exists, otherwise a Googlebot group.
  2. Only if no group names it does it fall back to User-agent: *.
  3. Groups with the same User-agent are combined, even if they appear in different parts of the file.

This is the mistake that catches most sites. Once you add a group for a specific crawler, it stops reading the * group entirely:

User-agent: *
Disallow: /wp-admin/
Disallow: /cart/

User-agent: Googlebot
Disallow: /private/

Here, Googlebot can crawl /wp-admin/ and /cart/ — its own group only blocks /private/. To keep the shared rules, repeat them in the Googlebot group.

User-agent names are case-insensitive: googlebot and Googlebot are the same group.

Which rule wins: Allow or Disallow

Inside the chosen group, every rule whose path matches the URL is a candidate. The longest matching path wins — not the first one in the file. If an Allow and a Disallow match with paths of the same length, Allow wins. A URL that matches no rule at all is allowed.

RulesURLResultWhy
Allow: /p · Disallow: //pageAllowed/p is longer than /
Allow: /folder · Disallow: /folder/folder/pageAllowedSame length — Allow wins the tie
Allow: /page · Disallow: /*.htm/page.htmBlocked/*.htm is longer
Allow: /$ · Disallow: //Allowed/$ matches only the home page
Allow: /$ · Disallow: //page.htmBlockedOnly Disallow: / matches

These are the examples from Google’s own robots.txt documentation — and the tester above returns the same result for each one.

Paths are case-sensitive. Disallow: /Admin/ doesn’t block /admin/.

Wildcards: * and $

Two characters change how a path matches, as defined in RFC 9309, the robots.txt standard:

  • * matches any sequence of characters, including none. Disallow: /*?sort= blocks every URL with a sort parameter, in any folder.
  • $ marks the end of the URL. Disallow: /*.pdf$ blocks URLs that end in .pdf — but not /file.pdf?download=1.

Without a $, every rule is a prefix match. That’s why the trailing slash matters:

RuleBlocksDoesn’t block
Disallow: /blog/blog, /blog/, /blog-tips/, /blogroll—
Disallow: /blog//blog/, /blog/post//blog, /blog-tips/
Disallow: /*.pdf/file.pdf, /file.pdf?v=2, /a.pdfx—
Disallow: /*.pdf$/file.pdf/file.pdf?v=2, /a.pdfx

What robots.txt can’t do

robots.txt controls crawling, not indexing. A page blocked in robots.txt can still appear in search results — usually as a bare URL with no description — if other pages link to it.

To keep a page out of search results, use noindex — a meta tag in the page or an X-Robots-Tag HTTP header. And don’t block that page in robots.txt at the same time: if Google can’t crawl the page, it never sees the noindex.

Noindex inside robots.txt doesn’t work. Google stopped supporting it in 2019, and the tester above flags it.

robots.txt is public and voluntary. Anyone can read it — so listing a secret path there advertises it — and only well-behaved crawlers follow it. To keep impostors out, verify crawlers by IP, as we explain in how to verify Googlebot and AI crawlers.

How Google handles robots.txt errors

What your server returns for /robots.txt matters as much as what the file says:

ResponseWhat Google does
200 OKReads the file and follows its rules
Redirect (3xx)Follows up to five redirects
404 or other 4xx (except 429)Treats it as if there’s no robots.txt — crawls everything
5xx or 429Treats the whole site as disallowed — stops crawling — and retries

A 5xx on robots.txt is the expensive one. If the file keeps failing, Google stops crawling the site; after 30 days, it falls back to the last copy it cached, or crawls without restrictions if it has none. Make sure robots.txt stays reachable even when the rest of the site has problems.

Two more limits: Google reads only the first 500 KiB of the file and ignores the rest, and it usually caches robots.txt for up to 24 hours — so a change can take a day to take effect.

The most common robots.txt mistakes

  • Disallow: / left over from staging. It blocks the entire site — test your live file after every launch.
  • A specific group that drops the shared rules, as in the Googlebot example above.
  • Blocking CSS and JavaScript. Google renders pages to understand them; blocking the files it needs to render can hurt how your pages are evaluated.
  • Forgetting the trailing slash — Disallow: /blog also blocks /blog-tips/.
  • Using robots.txt to hide private pages. The file is public; use authentication instead.
  • Combining noindex and a robots.txt block on the same page.

To block AI crawlers specifically, generate the rules with our AI crawler robots.txt generator — then paste the result into the tester above to check it.

Frequently asked questions

How do I test my robots.txt file?
Paste the file into the tester on this page, enter the URLs you want to check and choose a crawler. It shows whether each URL is allowed or blocked and the rule that decides. In Google Search Console, the robots.txt report shows how Google fetched and parsed your file, and the URL Inspection tool reports whether a specific URL is blocked.

What happened to Google’s robots.txt Tester?
Google retired the robots.txt Tester in Search Console in 2023 and replaced it with the robots.txt report, which shows the files Google found, when they were last crawled and any parsing problems. To check whether a specific URL is blocked, use URL Inspection or a tester like the one on this page.

Which rule wins when Allow and Disallow both match?
The rule with the longest matching path wins, wherever it appears in the file. If an Allow and a Disallow rule have paths of the same length, the Allow rule wins.

*Does a specific User-agent group inherit the rules from User-agent: ?
No. A crawler follows only the most specific group that names it, and ignores the * group completely. To apply shared rules to a specific crawler, repeat them in its group.

Is robots.txt case-sensitive?
The paths in Allow and Disallow rules are case-sensitive: /Admin/ and /admin/ are different. User-agent names and directive names are not.

What do * and $ mean in robots.txt?
* matches any sequence of characters, and $ marks the end of the URL. Disallow: /*.pdf$ blocks URLs that end in .pdf, while Disallow: /*.pdf also blocks URLs with anything after .pdf, such as a query string.

Does blocking a page in robots.txt remove it from Google?
No. robots.txt stops crawling, not indexing — a blocked page can still appear in results if other pages link to it. To remove a page from search results, use a noindex meta tag or the X-Robots-Tag header, and leave the page crawlable so Google can see it.

Does Google support Crawl-delay?
No. Google ignores Crawl-delay; Bing and Yandex follow it. To slow Googlebot down, the server can return 429 or 503 responses temporarily.

What happens if my robots.txt returns an error?
A 404 makes Google treat the site as having no robots.txt, so it crawls everything. A 5xx or 429 makes Google treat the whole site as disallowed until the file becomes available again.

Keep robots.txt — and the rest of your site — reachable

A robots.txt that fails with a server error can stop Google from crawling your entire site. Copahost hosting comes with cPanel, so you can edit robots.txt in the File Manager, read your access logs to see which crawlers visit, and keep your site on infrastructure built to stay online.

See hosting plans →

Conclusion

Three rules explain almost every robots.txt surprise. A crawler follows only the most specific group that names it. Inside that group, the longest matching rule wins — and Allow wins a tie. And without a $, every rule is a prefix, so a missing trailing slash blocks more than you meant.

The rest is knowing what the file can’t do: it controls crawling, not indexing, and it only works if the server can deliver it. Test every change before it goes live — paste the new file into the tester above with the URLs that matter most — and check the robots.txt report in Search Console after Google picks it up.

Share the Post:
Picture of Gustavo Gallas

Gustavo Gallas

Graduated in Computing at PUC-Rio, Brazil. Specialized in IT, networking, systems administration and human and organizational development​. Also have brewing skills.