Robots.txt Generator & Tester

Build a robots.txt with presets for blocking AI crawlers, staging lockdown and WordPress, plus a tester for path/bot rules. Free, private, no upload.

🌐 Español

Start from a preset:

Rule group 1

Generated robots.txt

Tester — is a path allowed for a given bot?

Checks the rule groups above (not the live site) against the path/bot you enter, using the longest-matching-rule-wins convention real crawlers follow.

🔒 Private by design: everything runs locally in your browser and never uploaded to any server.

A handshake agreement from 1994, not a lock

Robots.txt began as an informal convention among early web crawler authors and stayed informal for decades before finally being written up as a standard. That history explains its two most misunderstood properties.

First, it is entirely advisory. A crawler reads the file, decides to respect it, and skips the paths you listed. A crawler that does not care simply requests them. There is no enforcement anywhere in the chain, which is why a Disallow line is closer to a sign on a door than a lock on one.

Second, it is public by design. Your robots.txt sits at a fixed, guessable URL that anyone can open. Listing Disallow: /internal/exports/ advertises the existence of that directory to every person who thinks to look. If a path is sensitive, the file is the wrong place to name it; block the parent, or better, put real authentication in front of it.

Both facts matter most for the “Staging lockdown” preset. It genuinely does keep well-behaved search engines out of a staging subdomain, which is the usual goal, but it does not make the site private in any meaningful sense.

Longest match wins, not first match

This is the rule that catches almost everyone. Read a robots.txt top to bottom and it looks like a firewall config where order decides the outcome. It is not. Within the rule group that applies to a bot, every Allow and Disallow pattern that matches the requested path is collected, and the one with the most characters wins. A tie on length goes to Allow.

WordPress makes the canonical example. The pattern /wp-admin/ is 10 characters and /wp-admin/admin-ajax.php is 24, so the narrow Allow wins for that one file and the broad Disallow still covers everything else in the directory. Nothing about that outcome depends on which line you wrote first, and moving the Allow above the Disallow changes nothing.

Where this bites is when you assume the reverse. Writing Disallow: / followed by Allow: /blog does work, because /blog is longer than /. Writing Disallow: /products/hidden/ and expecting a later Allow: /products/ to override it does not, because the Disallow pattern is longer. That is why the tester exists below the generated file rather than as an afterthought.

What the tester actually reports

Type a path and a user-agent and it walks the same three steps a crawler does. It picks the most specific rule group for that bot, preferring an exact name match over the * group. It collects every pattern in that group that matches your path. Then it applies longest-wins with the Allow tie-break and tells you which pattern decided it, quoted verbatim so you can find the line you need to change.

Two default-allow cases are worth knowing, because they surprise people who expect a blocked answer. If no rule group applies to the bot at all and there is no * group, the path is allowed. If a group does apply but none of its patterns touch your path, the path is also allowed. Robots.txt has no implicit deny; anything you did not disallow is fair game.

The matching itself is deliberately spec-faithful in a couple of small ways. An empty value after Disallow: never counts as a match, because a bare Disallow: means “no restriction” rather than “block everything”. And comparisons are case-sensitive, so /Admin/ and /admin/ are two different paths as far as a crawler is concerned.

What * and $ do inside a path

Every pattern is a prefix match by default, so /private already covers /private/notes.html without any wildcard at all. The two extra characters change that.

An asterisk matches any run of characters, including none. /*.pdf therefore matches /reports/q3.pdf and also /q3.pdf. A trailing dollar sign anchors the pattern to the end of the URL, so /*.pdf$ matches /q3.pdf but not /q3.pdf?download=1, which is exactly the distinction you want when a query string is appended to your file downloads. Note that a wildcard counts as one character for the longest-match comparison, so a heavily wildcarded pattern is not automatically the more specific one.

Building the file and where it has to live

  1. Start from a preset. “Allow all” is the open baseline, “Block AI crawlers” loads the eleven AI user-agent tokens into a single shared rule group, “Staging lockdown” blocks everything for every bot, and “WordPress” sets up the /wp-admin/ plus admin-ajax.php pair described above.
  2. Edit the rule group. User-agents accept commas or one per line; Disallow and Allow take one path per line. Blank lines are dropped, and a group with no user-agent at all is skipped entirely rather than emitting orphaned rules.
  3. Add more groups if different bots need different treatment, for example an open * group plus a stricter group naming one crawler.
  4. List your sitemap URLs. They are written as Sitemap: lines at the end of the file, which is valid anywhere but conventional there.
  5. Test the paths you care about, then copy or download the result.

The finished file has to be named exactly robots.txt and served from the root of the host it applies to, as in https://example.com/robots.txt. A crawler will never look in a subfolder for it, and rules on one host do not apply to another; a subdomain needs its own file. While you are assembling a site’s launch checklist, Schema Markup Generator covers the structured-data side, Privacy Policy Generator the legal page, and SERP Pixel Counter checks whether your titles survive Google’s width limit.

See it in action

Screenshot of the Robots.txt Generator & Tester tool with presets for allow-all, blocking AI crawlers, a staging lockdown and WordPress, then editable rule groups taking one user-agent per line, assembling the robots.txt beneath them
Robots.txt Generator & Tester mid-process: presets for allow-all, blocking AI crawlers, a staging lockdown and WordPress, then editable rule groups taking one user-agent per line, assembling the robots.txt beneath them.
Diagram: where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen
Where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen.

Frequently asked questions

If I add a Disallow rule, can a bot still read the page?

Yes. Robots.txt is a request, not a permission system, and it is only honoured by crawlers that choose to honour it. Google, Bing and the mainstream AI crawlers do; a scraper written this afternoon does not, and anyone who already has the URL can simply fetch it. If you need a page to be genuinely unreachable, use HTTP authentication, an IP allowlist or a login, not a Disallow line.

Why did my Allow rule lose to a broader Disallow?

It probably did not lose, but check the character counts. Crawlers do not use first-match or last-match ordering; the pattern with the most characters wins, and only if two matching patterns are exactly the same length does Allow break the tie. So Allow /wp-admin/admin-ajax.php beats Disallow /wp-admin/ because it is longer, while a short Allow inside a long Disallow path will not. Paste the exact path into the tester and it will name the winning pattern.

Will Disallow keep a page out of Google's search results?

Not reliably. A blocked page can still be indexed as a bare URL if other sites link to it, because Google knows the page exists but is not allowed to fetch it and read a noindex tag. To keep a page out of results, let crawlers fetch it and serve a noindex meta tag or X-Robots-Tag header instead. Blocking in robots.txt is for saving crawl budget on pages you do not want fetched at all.

How current is the AI crawler list in the preset?

It carries eleven tokens that were verified against real-world guidance rather than recalled from memory, covering OpenAI, Common Crawl, Google's AI-training opt-out, ByteDance, Anthropic, Perplexity, Meta and Amazon. AI companies rename and launch crawlers regularly, so treat the preset as a good current baseline and add any newer user-agent you care about to the same rule group.

Does the tester understand crawler families like Googlebot-Image?

No, and that limitation is deliberate rather than accidental. It matches a user-agent exactly (ignoring letter case) against the names in your rule groups, and falls back to the "*" group when no exact name matches. Real crawlers do apply some family logic, so if you have a group named Googlebot and you want to know what Googlebot-Image sees, test both names separately.

Is the Crawl-delay field worth filling in?

Usually not. Google ignores Crawl-delay entirely and manages its own request rate, so setting it there does nothing. Some other crawlers, including Bing and Yandex historically, do read it, so it is worth setting if a specific bot is hammering a slow server. Leave the field empty and no Crawl-delay line is written at all.

Related tools