How to test robots.txt rules for a URL
Short answer
Paste the policy into the robots.txt Tester, enter a URL or slash-prefixed path, and choose a crawler product token such as Googlebot. Read the selected groups and winning source line, then review warnings. The result explains the pasted rules; it does not verify a live file or indexing status.
Start with the policy you intend to publish
A local test helps you find a mistaken path, unexpected crawler group, or missing exception before publishing. Copy the complete file into the robots.txt Tester. Include the User-agent lines: an isolated Disallow line has no group and is ignored with a warning.
- Paste the complete rulesUse Load example for a starting policy, or paste your own plain-text robots.txt. The tester accepts up to 500 KiB and reports ignored lines.
- Enter the URL or pathTry an HTTP(S) URL such as https://example.com/private/report, or just /private/report. The visible matched path includes the query string and excludes any fragment.
- Choose the crawler tokenEnter Googlebot, Bingbot, another token made of letters, hyphens and underscores, or * for wildcard groups. A full browser User-Agent string is not accepted.
- Trace the resultCheck which groups were selected and which source line won. Expand All matching rules to compare competing patterns, then review every warning before using the result.
- Test nearby URLsChange case, add or remove a trailing slash, and try a query string. Test the intended exception as well as the URL you want to restrict.
Example: allow a public folder inside a restricted one
User-agent: *
Disallow: /private
Allow: /private/public/private/reportis disallowed by line 2./private/public/reportis allowed by the longer pattern on line 3./private-publicstill matches/private, because these are prefixes rather than folder names./Private/reportdoes not match the lowercase patterns. Path matching is case-sensitive.
A specific crawler group changes the rules in play
User-agent: *
Disallow: /private
User-agent: Googlebot
Disallow: /draftsFor Googlebot, /drafts is restricted by its selected group; /private has no matching restriction. The wildcard group is a fallback, so its rules are not added to a matching specific group. Multiple groups with the same product token are combined. An empty specific group also prevents wildcard fallback.
Queries, fragments, and escaped characters
With Disallow: /*.pdf$, /manual.pdf matches but /manual.pdf?download=1 does not: $ reaches the end of the path and query. /manual.pdf#page=2 matches because fragments are excluded. Use the matching reference for examples of %2F, literal asterisks, and UTF-8 paths.
Use warnings to find a policy the tester cannot interpret
The result considers only accepted User-agent, Allow, and Disallow lines. Sitemap, Crawl-delay, Noindex, and other records produce warnings and do not affect the decision. Empty Allow or Disallow values are ignored; they do not erase other restrictions. A file with no valid group receives an invalid-input result.
After correcting the policy, use the robots.txt Generator to prepare a file, and check the directives reference for hosting and directive context. Verify the actual file served for the intended scheme, hostname, and port through your deployment workflow.