Tool 04 · Crawl

Robots.txt builder and inspector

Draft a readable robots.txt file, parse an existing one, find duplicate or risky rules, validate the sitemap line, and test whether a path is allowed or blocked.

Version 2.0.0 · Last tested 2026-11-28 · Maintained by Mark · Test cases · How we test

Related tests: ROB-01 to ROB-05 · Known limit: does not fetch the live robots.txt and cannot enforce access control.

One name, or several separated by commas. Use * for all crawlers.

Generated file

This result describes the pasted input. It is not a Google ranking, indexing or eligibility decision.

The grammar

Groups, rules and the sitemap line.

A robots.txt file is a set of groups. Each group starts with one or more User-agent lines, followed by Allow and Disallow rules. A Sitemap line is a global pointer, not a rule inside a group.

LineWhat it doesExample
User-agentSelects the crawler groupUser-agent: *
AllowPermits a path that may otherwise match a longer DisallowAllow: /private/public/
DisallowAsks a cooperative crawler not to request a pathDisallow: /private/
SitemapPoints to an XML sitemapSitemap: https://example.com/sitemap.xml

The builder supports one group with one or more user-agent names. For a file with several groups, paste it into the inspector; it parses the groups and applies the path test to the most specific matching group.

Common mistakes

Rules that block the wrong thing.

  • Disallow: / blocks the whole site for that group. It is rarely what a public site wants.
  • Blocking CSS or JavaScript can stop a crawler from seeing how the page renders. Check the rendered-page guidance before blocking assets.
  • Empty Disallow: does not block anything. It is noise, not a rule.
  • Duplicate rules make the file harder to audit and can hide an old intent.
  • Using robots.txt as a password fails. A disallowed URL can still be linked, discovered or requested by a crawler that ignores the file.
  • A relative sitemap value is not a valid sitemap URL. Use the full https URL.

Path test

Longest match, allow wins ties.

The inspector follows the common robots.txt matching model: the most specific group for the crawler is used, the longest matching rule wins, and an Allow wins a tie against a Disallow of the same length. Wildcards * and the end anchor $ are supported.

Example: with Disallow: /private/ and Allow: /private/public/, the path /private/public/page is allowed because the Allow rule is longer. The path /private/draft is blocked.

The result is a model, not a promise. Each crawler implements the file itself, and a crawler may ignore a rule. Use server-side access control for anything private.

Security

Robots.txt is not access control.

A disallowed URL can still appear in links, sitemaps, browser history and referrers. It can also be requested directly by a person or a bot that does not follow the file. If a file must be private, protect it with authentication, a signed URL or server permissions.

Use robots.txt to guide crawling, not to hide secrets. If you need a page removed from search results, use a noindex directive or response header, and make sure the crawler can actually fetch the page to see it.

Check the deployed file. A local draft is not the live file. Fetch https://your-domain/robots.txt after deployment and confirm the response and the contents.

Test record

Cases that exercise the parser.

CaseExpected result
Duplicate DisallowWarning: duplicate rule
Disallow: /Warning: blocks the whole site
Empty Disallow:Warning: does not block anything
Relative sitemapWarning: sitemap must be absolute
Allow beats a longer DisallowPath allowed
No matching rulePath allowed

Limits

What the tool cannot know.

  • How every crawler implements wildcards, group selection or redirects.
  • Whether a crawler will honor the file at all.
  • Whether a URL has been discovered through a link, a sitemap or another source.
  • The live response, the server status or a WAF rule.
  • Whether a page is indexed. Robots.txt controls crawling, not indexing directly.

The Test Lab runs the current parser and path cases in your browser.

Questions about robots.txt.

For a parsing problem, include the exact file and the path you tested. Remove any private hostnames before sending it.

Does Disallow remove a page from Google?

Not reliably. Disallow asks a crawler not to request the URL. A disallowed URL can still be indexed from links or other signals, often without a useful snippet. To keep a page out of search results, use noindex and make sure the page can be crawled.

Should I block admin or login pages?

You can, but robots.txt is not protection. Put authentication and server-side access control on those pages first. Blocking them in robots.txt is a secondary crawling hint.

Can I have several User-agent groups?

Yes. The inspector parses them. The builder focuses on one group with one or more agent names. For a complex file, edit the text and inspect it.

Why does the path test say allowed when I expected blocked?

Check the group selection, the longest matching rule and any Allow rule that is longer than the Disallow. The tool explains which rule matched; compare that with the deployed file.