Robots.txt is a small file with an outsized blast radius. One misplaced line can block every crawler from your whole site, and one misunderstood rule can leave the folder you meant to protect wide open. The awkward part is that the file gives no feedback: you publish it, and the consequences arrive weeks later as missing pages or crawled pages that should never have been crawled.
This guide shows how to test the file before it goes live, using the free Robots.txt Tester on Ovatly. The tester checks whether a specific crawler is allowed to fetch a specific path under a given robots.txt file, and shows exactly which rule decided the result.
Contents
- Quick answer
- What the tester checks, and what it does not
- How the matching rules decide
- The group rule that catches people out
- Wildcards and the end anchor
- How to test your file, step by step
- Worked example: one file, two opposite verdicts
- Limitations
- Common mistakes
- FAQs
- Conclusion
Quick answer
Paste your robots.txt content into the Robots.txt Tester, type the crawler name (for example Googlebot or Bingbot), type the path or full URL you want to check, and read the verdict with the explanation of the matching rule. Test every crawler that matters and every path you care about, especially the ones you just changed. Remember the default: if no Disallow rule in that crawler's group matches the path, the path is allowed.
What the tester checks, and what it does not
The tester answers one precise question: under this exact file, may this exact crawler fetch this exact path? It implements the RFC 9309 matching rules, including wildcards, end anchors, crawler-specific groups and longest-match wins, and it names the rule that decided the outcome.
Two boundaries are worth knowing before you start. First, the tester evaluates one file and one crawler at a time, and it does not fetch your live robots.txt. You paste the content in yourself, which is what makes it safe for pre-publish testing: the draft you are about to upload is exactly the text you test. Second, the verdict is about crawling, not indexing. Robots.txt blocks fetching; it does not remove URLs from search results, and a disallowed page can still appear in Google if other pages link to it.
How the matching rules decide
Four rules from RFC 9309 do most of the work, and the tester applies all of them:
- The crawler's own group wins. If the file has a group naming the crawler, that group decides. The * group no longer applies to that crawler.
- The longest matching pattern wins. When two rules in the group both match a path, the longer, more specific pattern is the one that counts.
- Allow wins a tie. If an Allow and a Disallow pattern match with equal length, the path is allowed.
- An empty pattern matches nothing. A Disallow with nothing after it blocks nothing.
Matching is literal in ways that surprise people. Paths are matched exactly as written, including case, so a rule written for one capitalisation does not cover another. Percent-encoded paths are compared in their encoded form, as the standard specifies, so test encoded URLs in the form the crawler will request.
The group rule that catches people out
The single most common source of wrong expectations is the group rule. Many site owners write a * group with their general rules, then add a small group for one crawler, perhaps to slow it down or block one folder, and assume the general rules still apply underneath. They do not. The moment a crawler has its own named group in the file, it follows only that group, and every rule in the * group stops applying to it.
This cuts both ways: a folder blocked for everyone in the * group is open to a crawler with its own group unless you repeat the block there. The fix is boring and reliable: test as each named crawler, not just a generic one, and read which group the deciding rule came from.
Wildcards and the end anchor
Two characters extend what a pattern can match. The * character matches any sequence of characters, so a pattern such as /.php matches PHP files in any folder. A trailing $ anchors the pattern to the end of the path, and that changes the meaning: /.php$ does not match /index.php?print=1, because the path continues past the .php part. Without the anchor, the same pattern would match that URL.
These two are where intent and file most often drift apart. A pattern written to cover "all PHP files" quietly covers PHP files with query strings too, and a pattern written to block one exact file can block a whole family of URLs. Test the boundary cases, not just the obvious path: the plain file, the file with a query string, and a file in a subfolder.
How to test your file, step by step
- Open the Robots.txt Tester. A sample file is preloaded, so you can see the format before pasting your own.
- Paste your robots.txt content over the sample: the exact draft you intend to publish, not a tidied summary of it.
- Type the crawler name, for example Googlebot or Bingbot.
- Type the path or full URL you want to check.
- Read the verdict and the explanation. If the deciding rule is not the one you expected, the file, not the tester, needs to change.
- Repeat for each crawler with its own group in the file, and for each path you recently added rules about.
Worked example: one file, two opposite verdicts
The tester's preloaded sample file shows the group rule in action. Testing the path /private/data as Googlebot returns Blocked, decided by the rule "Disallow: /private/" in Googlebot's own group.
Now test /admin/settings as Googlebot. The verdict is Allowed. If the sample's * group contains a rule you expected to block admin paths, it does not apply here, because Googlebot has its own group in this file and follows only that group. The tester makes this visible by naming the deciding rule, or the absence of one.
That pair of results is the whole argument for testing before publishing: both verdicts are correct applications of the standard, and only one matches what most people predict from a quick read of the file.
Limitations
The tester checks the text you paste, one crawler at a time. It cannot tell you whether the file on your server matches the text you tested, so after publishing, paste the live file back in and run the key checks again. It also says nothing about indexing, only about fetching. Finally, a verdict is only as complete as your test list: paths and crawlers you never test keep whatever behaviour the file gives them, unexamined.
Common mistakes
- Testing only as one crawler. A file can be correct for Googlebot and wrong for every crawler named in its own group. Test each named crawler separately.
- Assuming disallowed means removed from Google. Blocking a fetch does not unlist a URL that other pages link to. The tester reports crawling behaviour only.
- Forgetting case sensitivity. Paths match exactly as written, including case. Test the path in the form the crawler will actually request.
- Dropping the end anchor. Without a trailing $, a pattern also matches longer paths that merely start the same way, such as a file name plus a query string.
- Assuming no rule means blocked. The default runs the other way: no matching Disallow in the crawler's group means the path is allowed.
FAQs
A page is disallowed but still appears in Google. Why? Robots.txt blocks fetching, not indexing. If other pages link to it, Google can list the URL without crawling its content. The tester tells you about crawling only.
What does the * user agent mean? The * group applies to every crawler that does not have its own named group in the file. Crawlers with their own group follow only that group.
How do wildcards and $ work? The * character matches any sequence of characters, so a pattern like /.php matches PHP files in any folder. A trailing $ anchors the pattern to the end of the path, so /.php$ does not match /index.php?print=1.
If no rule matches my path, is it blocked? No. Robots.txt is permissive by default: a path is allowed unless a matching Disallow rule in the crawler's group says otherwise.
Does the tester check my live robots.txt file? No. You paste the file content in, and the tester evaluates that one file for one crawler at a time. It does not fetch your live robots.txt, which makes it safe for testing a draft before you publish it.
Conclusion
A robots.txt file is a set of instructions that crawlers interpret literally, by rules most people only half remember: the named group wins, the longest pattern wins, Allow wins ties, and silence means yes. Testing turns those rules from trivia into a checklist. Paste the draft into the Robots.txt Tester, run each named crawler against the paths you care about, and read the deciding rule before the file goes anywhere near your server. For the other half of how your pages present themselves, see the companion guide: How to Add Twitter Card Tags for Better-Looking Shares. More checks like these are collected in the SEO Tools guides archive.