HandyBench

Robots.txt Generator

Build a valid robots.txt in seconds.

A bot that has its own group follows only that group and ignores the rules for all bots above, so repeat any rule it should keep.

User-agent: *
Disallow: /admin
Disallow: /cart
Disallow: /checkout

Sitemap: https://example.com/sitemap.xml

How to use the Robots.txt Generator

  1. 1 Choose "Allow all (with exceptions)" or "Block all crawlers".
  2. 2 List the paths to disallow (each starting with /), one per line, plus any Allow paths that should stay open, and optionally a crawl-delay in seconds and bots to block entirely.
  3. 3 For rules that apply to one crawler only, press "Add bot group" and give it a bot name with its own Disallow and Allow paths.
  4. 4 Add your sitemap URL.
  5. 5 Copy or download the file and upload it to your domain root.

What a robots.txt file does, and what it does not

A robots.txt file is a plain text file at the root of a host, such as https://example.com/robots.txt, that tells crawlers which URL paths they may request. The format is standardised as the Robots Exclusion Protocol in RFC 9309. It controls crawling, not indexing. A URL blocked in robots.txt can still appear in search results, usually with no description, if other pages link to it. Worse, a crawler that cannot fetch the page cannot see a noindex tag on it. To keep a page out of search, leave it crawlable and add noindex, or put it behind a login. Robots.txt is also not a security measure: it is public, and it advertises the very paths you list.

What this generator outputs

The tool always starts with a group for User-agent: * (all crawlers). Choose "Allow all (with exceptions)" and each line in the disallow box becomes a Disallow: line, or choose "Block all crawlers" for Disallow: /. Each line in the allow box becomes an Allow: line in the same group, which is how you open a sub-path inside a blocked folder. With both boxes empty you get a bare Disallow:, which means nothing is blocked. A crawl-delay value adds a Crawl-delay: line to that group. Bots named in the "Block specific bots entirely" field (for example GPTBot, CCBot) each get their own group with Disallow: /, and a Sitemap URL is added as a final Sitemap: line.

For anything finer, press "Add bot group". Each group takes one or more bot names (comma separated, for example Googlebot, Bingbot, written as consecutive User-agent: lines), its own Disallow and Allow paths and its own crawl-delay. A crawler obeys only the single most specific group that names it and ignores the * group, so a group for Googlebot must repeat any rule from the general group that Googlebot should still follow. The defaults produce:

User-agent: *
Disallow: /admin
Disallow: /cart
Disallow: /checkout

Sitemap: https://example.com/sitemap.xml

The input is checked before it is written. A disallow entry that does not start with / (or *), such as a pasted full URL, is left out with a warning, because crawlers would not match it as intended. The same check applies to Allow paths and to every bot group. Crawl-delay must be a plain number of seconds, bot names may only use letters, digits, dots, dashes and underscores (or *), and the Sitemap must be a full http(s) URL; anything invalid is omitted and explained. The tool also warns when one bot appears in two groups, because crawlers merge those groups, which is easy to misjudge.

How matching works (RFC 9309)

RuleBehaviour
Disallow: /adminPrefix match. Blocks /admin, /admin/users and /administrator.
Disallow: /admin/Blocks only paths inside that folder.
CasePaths are case-sensitive: /Admin is a different path.
Wildcards* matches any characters and $ anchors the end, for example Disallow: /*.pdf$.
ConflictsThe longest matching rule wins; if an Allow and Disallow tie, Allow wins.
Missing file (4xx)Crawlers treat everything as allowed.
Server error (5xx)Crawlers may assume everything is disallowed until it recovers.

Common mistakes

  • Shipping "Block all crawlers" to production. It is right for a staging site and disastrous on a live one. Check /robots.txt after every launch.
  • Blocking CSS and JavaScript. Google renders pages, and blocked resources can make a page look broken to it.
  • Expecting Crawl-delay to work everywhere. It is not part of RFC 9309. Google ignores it, though some other crawlers, including Bing's, honour it.
  • A relative Sitemap URL. The Sitemap line is an extension supported by the major engines and needs a full absolute URL.
  • Wrong location. The file only applies to the exact protocol, host and port it is served from. A copy in a subfolder is ignored.

After uploading, test specific URLs with the robots.txt tester, and build the file it points to with the XML sitemap generator. The meta tag generator can add a noindex tag when you need to keep a page out of results.

Examples

  • ▸ Disallow paths /admin, /cart and /checkout with sitemap https://example.com/sitemap.xml outputs User-agent: *, three Disallow lines, a blank line and a Sitemap line.
  • ▸ Choosing "Block all crawlers" outputs User-agent: * and Disallow: / and is meant for staging sites, not live ones.
  • ▸ Entering GPTBot, CCBot in the block-specific-bots field adds a separate group for each with Disallow: /, while every other crawler keeps your normal rules.
  • ▸ Disallowing /private and allowing /private/press writes both lines in one group, so crawlers skip the folder but may still fetch the press pages, because the longer matching rule wins.

Frequently asked questions

Where does robots.txt go?

It must live at the root of your domain, e.g. https://example.com/robots.txt, so crawlers can find it automatically.

Does robots.txt hide a page from Google?

No. Disallow stops crawling but a page can still be indexed if linked elsewhere. Use a noindex meta tag to keep it out of search, and do not block that page in robots.txt or crawlers will never see the tag.

Does this tool support Allow rules or rules for specific bots?

Yes. The main group (User-agent: *) takes Disallow lines, Allow lines and an optional Crawl-delay. "Add bot group" creates a separate group for one or more named crawlers, each with its own Disallow paths, Allow paths and Crawl-delay, and the quick field still blocks listed bots (such as GPTBot) entirely. Remember that a crawler follows only its most specific group, so repeat any shared rule inside a bot group.

What does the tool check in my input?

Disallow and Allow paths must start with / (or *), so a full URL or a bare word is left out with a warning. Crawl-delay must be a plain number of seconds, bot names may only contain letters, digits, dots, dashes and underscores, and the Sitemap must be a full http(s) URL. A bot named in two groups is flagged too. Anything invalid is omitted and explained rather than written into the file.

Does Google obey Crawl-delay?

No. Google ignores Crawl-delay, and the directive is not part of RFC 9309. Some other crawlers, such as Bing, do honour it, so the field is only useful for those.

What happens if my site has no robots.txt?

If the file returns a 404, crawlers treat the whole site as allowed. If it returns a server error (5xx), crawlers may temporarily assume everything is disallowed, so keep the file reliably available.