A robots.txt tester checks whether a crawler is allowed to fetch a URL under your robots.txt rules by finding the user-agent group that applies and the longest matching Allow or Disallow rule.
Test your robots.txt
Paste the file, add URLs or paths (one per line) and pick a crawler. Nothing is fetched or sent.
This tester works on pasted text, so you can check a draft before it goes live or test a file you cannot fetch from here. It follows RFC 9309, the Robots Exclusion Protocol standard, plus the behaviour Google documents in How Google interprets the robots.txt specification: group selection, merging of groups, wildcards, the 500 KiB size limit and the fields Google ignores.
How to copy your robots.txt into the tester
- Open your site in a browser, then replace everything after the domain with
/robots.txt. Select all of the text and copy it. - In Search Console, open Settings, then the robots.txt report, and click the file to see the version Google last fetched.
- On a command line,
curlfollowed by the file address downloads an exact copy.
Each host needs its own file. Rules in the file on the main domain do not apply to a subdomain, to another protocol or to a non-standard port, and Google does not look for robots.txt files in subfolders. If your URL list mixes hosts, test each host against its own file.
How the result is calculated
Each URL goes through two steps: pick the group of rules for the crawler, then find the rule in that group that matches the URL path most specifically. If no rule matches, the URL is allowed. The file itself, /robots.txt, is always allowed.
Choosing the user-agent group
A group is one or more User-agent lines followed by rules. Only one group applies to a crawler: Google picks the group with the most specific user agent that matches and ignores the rest, and the order of groups in the file does not matter. If several groups name the same crawler, their rules are merged into one. A crawler that matches no named group follows the * group; if there is none, nothing is blocked.
Some Google crawlers answer to more than one token. Googlebot-Image, for example, obeys a Googlebot-Image group if there is one and otherwise the Googlebot group (Google crawler documentation). The tester applies that fallback for Googlebot-Image, Googlebot-News and Googlebot-Video. Text after the name is ignored, so Googlebot/2.1 counts as Googlebot. AI search crawlers such as OAI-SearchBot and PerplexityBot are matched by their own tokens in the same way, and our guide to visibility in AI search engines lists the token each platform reads.
User-agent: *
Disallow: /search
User-agent: Googlebot
Disallow: /private
# Googlebot follows only its own group: /search is allowed for itLongest match, Allow vs Disallow, wildcards and $
Inside the group, the rule with the longest path that matches wins. When an Allow and a Disallow rule match with the same length, Google uses the less restrictive Allow. Paths are case-sensitive and must start with /. Two wildcards are supported: * for any sequence of characters and $ for the end of the URL.
| URL path | Rules | Winner | Why |
|---|---|---|---|
| /page | Allow: /p Disallow: / | Allow: /p | Longer match |
| /folder/page | Allow: /folder Disallow: /folder | Allow: /folder | Same length: Allow wins |
| /page.htm | Allow: /page Disallow: /*.htm | Disallow: /*.htm | Longer rule path |
| / | Allow: /$ Disallow: / | Allow: /$ | Longer match |
| /page.htm | Allow: /$ Disallow: / | Disallow: / | /$ only matches the root |
| /fish.php?id=1 | Disallow: /*.php$ | No match: allowed | $ requires the URL to end in .php |
A rule without $ is a prefix. Disallow: /fish blocks /fish, /fish.html and /fishheads, which is the most common source of surprise blocks.
Script and style files your pages load
Put the CSS and JavaScript addresses your templates request on the test list too, not only page URLs. Google’s robots.txt guide accepts blocking unimportant images, scripts or styles, yet warns against blocking any resource whose absence leaves a page harder for its crawler to understand. When a blocked URL ends in .js, .mjs or .css, the result adds a note saying so.
Syntax errors the validator flags
Google ignores lines it cannot parse and uses the rest, so a typo does not break the file; it silently drops a rule. The tester lists each problem with its line number and, where it can, the corrected line to publish.
- Unknown or misspelled fields, such as
DissalloworUser agent, with the field it probably meant. - Missing colon between field and value. RFC 9309 requires
field: value. - Rules before any User-agent line, which crawlers ignore.
- Paths that do not start with / and full URLs used as paths; neither ever matches.
- Fields Google does not support: crawl-delay, and noindex or nofollow lines, which belong in a robots meta tag instead, and our tag generator writes a valid robots meta tag for that job.
- Sitemap lines without a full URL, including protocol and host.
- Files over 500 KiB, which is 512,000 bytes (500 x 1,024). Google ignores everything after that limit.
- HTML instead of rules, which happens when a server returns an error page at the robots.txt address.
Compare two versions before you deploy
Most robots.txt accidents happen on deploy: a staging file with Disallow: / goes live, or a new prefix rule catches more than intended. Paste the live file and the new one with a list of your most important URLs, and the diff shows every URL that changes from allowed to blocked or back.
Before and after diff
Paste the live file and the version you plan to deploy, plus your key URLs. Only URLs whose result changes are listed.
robots.txt in Search Console: the robots.txt report
In November 2023 Google released the robots.txt report in Search Console and retired its older robots.txt tester (Search Engine Land coverage of the launch). The report shows which robots.txt files Google found for the top 20 hosts of a property, when each was last crawled, and any warnings or errors. It does not test individual URLs; for that Google points to URL Inspection, or to its open source robots.txt library for developers.
The report also lets you request a recrawl of the file. Google says you generally do not need to, because it recrawls robots.txt often, but suggests it when you unblock important URLs and want Google to know quickly, noting that this does not guarantee an immediate recrawl of the unblocked URLs.
Fixing a URL that is blocked by mistake
- Find the rule: run the URL through the tester and note the matching line.
- Narrow it: add
$, a trailing slash or a longer path, or add a more specific Allow line for the URL. - Run the diff with your key URLs so the fix does not open or close anything else.
- Publish the file at the root of the host and check that it returns status 200.
- Request a recrawl of the file in the robots.txt report if the change is urgent, then ask Google to crawl the affected URLs.
A disallowed URL can still be indexed without its content if other pages link to it, so a block is never a way to hide a page; the result simply shows without a description. Blocks also hurt links: a page that holds a backlink but is disallowed for Googlebot cannot pass anything Google never fetched. Our guide to robots.txt blocks on linking pages shows how to spot them in a link report.
Some of those pages are not yours. A syndicated press release on a news portal, for example, may sit under a Disallow rule the portal set. Ask the publisher to change the rule, because you cannot request a crawl for it in Search Console. Once it is unblocked, a URL indexer for press release copies handles the submission step.
Frequently asked questions
How do I test robots.txt now that Google’s tester is gone?
Paste the file and your URLs into the tester on this page, use URL Inspection in Search Console for individual URLs on your own property, and check the robots.txt report for fetch errors. robots.txt is one part of a wider crawl audit; the interactive technical SEO checklist puts it in order with the other checks.
Is my robots.txt valid?
Paste it into the tester. A valid file is UTF-8 plain text at the root of the host, under 500 KiB, with lines in the form field: value, rules inside a User-agent group and paths that start with /. Google ignores invalid lines rather than rejecting the file, so the question is usually whether a rule you rely on is being dropped.
Why is a URL blocked when I only disallowed a folder?
Because rules are prefixes. Disallow: /blog also blocks /blog-news/ and /blogger.html. Add the trailing slash, Disallow: /blog/, to block only the folder, or use $ to match an exact URL.
How long does Google take to see robots.txt changes?
Google generally caches robots.txt for up to 24 hours, and longer if it cannot fetch a fresh copy, for example because of timeouts or 5xx errors. You can speed up the file itself with the recrawl request in the robots.txt report; the URLs you unblocked are crawled on Google’s own schedule. If those URLs carry links to your site, the next question is usually how to index my backlinks, and our guide walks through it once the pages are crawlable again. To start from a clean file, write a new robots.txt with our generator; if Search Console already reports the URLs, our steps to fix ‘Blocked by robots.txt’ help. Crawling and indexing are separate problems, and we explain how to improve both. For the exact names to put in User-agent lines, see our list of Google crawler user agents.