Skip to main content

Robots.txt Generator

Build a robots.txt file with Allow and Disallow rules for multiple user-agents, crawl-delay and sitemap links, then copy it to your site's root folder.

Disallow paths

Allow paths

Sitemap URLs

Block AI training crawlers

Each switch adds a group that disallows the whole site for that crawler. Search engines are not affected.

robots.txt

Test a URL

See whether a crawler may fetch a page, using the same rules Google uses: the longest matching rule wins, Allow wins a tie, and * and $ work as wildcards.

Disallow: /admin

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Free Online Robots.txt Generator

Build a custom robots.txt with per-crawler Allow/Disallow rules and sitemap references, with live warnings for common mistakes. It helps site owners write crawler directives for a domain while keeping the rules readable and easy to review before deployment.

What robots.txt controls

robots.txt is a plain-text file at the root of a domain that gives web crawlers instructions about which parts of a site they're allowed to request. It's the first thing well-behaved crawlers check before crawling anything else, using simple User-agent, Allow, and Disallow directives, plus optional Sitemap lines pointing crawlers at your XML sitemap so they can discover pages more efficiently.

How to use this generator

Add one or more user-agent groups — use * to target every crawler, or a specific bot name like Googlebot for crawler-specific rules — then list the paths each group should or shouldn't crawl. Add your sitemap URL so crawlers can find it immediately, and watch the warnings panel for common mistakes like a relative sitemap URL or a rule that accidentally blocks your entire site.

Common use cases

  • Blocking crawlers from admin panels, staging paths, or internal search-result pages
  • Pointing all crawlers at your XML sitemap to speed up discovery of new pages
  • Giving one crawler (like an aggressive scraper bot) different, more restrictive rules than the rest
  • Double-checking an existing robots.txt for a mistake that's accidentally blocking the whole site

Everything is generated locally in your browser — no part of your configuration is sent to a server.

Common mistakes and edge cases

  • Two groups for the same crawler (for example two User-agent: * blocks) are flagged, because crawlers read only one of them. Use Merge groups for the same crawler to combine them.
  • The same path under both Allow and Disallow in one group is flagged, since it is unclear which one wins.
  • Paths are case-sensitive and match from the start of the address: Disallow: /fish also blocks /fish.html and /fishing, but not /Fish. A $ at the end of a rule stops that: /*.pdf$ blocks /a.pdf but not /a.pdf?download=1. Use Test a URL to check.
  • A numeric Crawl-delay only avoids this tool's own warning — it doesn't mean every crawler honors it. Google ignores Crawl-delay entirely regardless of value; only Bing and Yahoo respect it.

Worked example

Take one group for all crawlers (*) that blocks /admin/ but allows /admin/help, and add the sitemap https://example.com/sitemap.xml. The generator writes User-agent: *, then Disallow: /admin/, then Allow: /admin/help, a blank line, and finally Sitemap: https://example.com/sitemap.xml. Save the text as robots.txt in the top folder of the site.

Frequently asked questions

Where does robots.txt need to be placed?
At the root of your domain, e.g. https://example.com/robots.txt — search engine crawlers only look for it at that exact location, not in a subdirectory.
Does robots.txt actually prevent a page from being indexed?
Not reliably on its own — it asks well-behaved crawlers not to fetch matching URLs, but a URL can still appear in search results (without its content) if other pages link to it. To reliably keep a page out of search results, use a noindex meta tag or header on that page instead, which requires the page to be crawlable in the first place.
Can I have different rules for different crawlers?
Yes — add multiple groups, each with its own User-agent line (like Googlebot or Bingbot, or * for all crawlers). Crawlers use the most specific matching group that names them; everything else falls back to the * group.
Is this validated against a live site?
No — this only checks the syntax and structure of what you enter (like flagging a relative sitemap URL or a group that blocks everything). It doesn't know your site's actual URL structure, so use Test a URL below the file to try real addresses against the rules.
How does Test a URL decide if a page is allowed?
It follows the rules Google documents. The group that names the crawler is used (Googlebot, Bingbot and so on), otherwise the * group. Among the rules that match the start of the address, the longest one wins, and if an Allow and a Disallow are the same length, Allow wins. A * stands for any characters and a $ at the end means the address must end there. You can test the file you built or paste an existing robots.txt.
Does it warn me about duplicate or conflicting rules?
Yes. It flags groups that name the same crawler (and offers to merge them), a path listed under both Allow and Disallow, a group that blocks the whole site for all crawlers, a Crawl-delay (Google ignores it; Bing honours it) and a relative sitemap address.
How do I stop AI crawlers from using my site for training?
Switch on the crawlers you want to block in the AI section. Each one gets its own group with Disallow: /. This only works for crawlers that follow robots.txt, and it does not remove anything they already collected.
Will setting a Crawl-delay actually slow down Google?
No — Google ignores the Crawl-delay directive entirely, regardless of what value you set (it uses Search Console's crawl-rate settings instead). Bing and Yahoo do honor it. This tool warns when a non-numeric value is entered and reminds you that Google ignores the directive.
Can robots.txt block private data?
No. A robots.txt file is a polite request that well-behaved crawlers follow, and it is public: anyone can read it and see the paths you listed. Never rely on it to hide a private page. Protect private content with a login or server rules, and use noindex for pages that should not appear in search.

Related tools

More Data Generation & Utilities

View all Data Generation & Utilities tools →