What Robots.txt Generator does
Fill in the form and this robots.txt generator writes the complete file: a User-agent: * group with your Allow and Disallow lines, an optional Crawl-delay, an optional block of AI crawler rules, and a Sitemap line. You can copy the result or download it as robots.txt and upload it to the root of your site. The file tells well-behaved crawlers which URLs not to fetch. It does not remove pages from search results and it does not protect anything: a disallowed URL can still be indexed if other sites link to it, and anyone can read the file. Rules here apply to all crawlers at once; the only per-bot groups it writes are the AI crawler ones.
Robots.txt examples generated with this tool
Each result is the file the generator produced for the settings shown. Line breaks are written as vertical bars, and the comment line the tool puts at the top is left out.
Allow everything and list the sitemap
Default policy: Allow all. Paths to disallow: empty. Sitemap URL: https://example.com/sitemap.xml
User-agent: * | Disallow: | Sitemap: https://example.com/sitemap.xml
The Disallow line is empty on purpose. An empty value means nothing is blocked.
The default shop setup
Paths to disallow: /admin/, /cart, /checkout, /*?sessionid= (the values the page loads with)
User-agent: * | Disallow: /admin/ | Disallow: /cart | Disallow: /checkout | Disallow: /*?sessionid= | Sitemap: https://example.com/sitemap.xml
WordPress admin with one exception
Paths to disallow: /wp-admin/. Paths to allow: /wp-admin/admin-ajax.php. Sitemap URL: https://example.com/sitemap_index.xml
User-agent: * | Allow: /wp-admin/admin-ajax.php | Disallow: /wp-admin/ | Sitemap: https://example.com/sitemap_index.xml
The Allow line wins for that one file because it is the longer, more specific rule.
Staging site
Default policy: Block all crawlers entirely. Sitemap URL: empty
User-agent: * | Disallow: /
In this mode the path lists and Crawl delay are ignored, and the tool shows a warning under the output.
Faceted search and a crawl delay
Paths to disallow: search and /*.pdf$. Crawl delay: 10. Preferred host: https://www.example.com. Sitemap URL: empty
User-agent: * | Disallow: /search | Disallow: /*.pdf$ | Crawl-delay: 10 | Host: www.example.com
The slash before search was added and https:// was stripped from the host automatically.
Open to search engines, closed to AI crawlers
Paths to disallow: empty. Block AI training crawlers: ticked
User-agent: * | Disallow: | then twelve groups, from User-agent: GPTBot | Disallow: / through to User-agent: Meta-ExternalAgent | Disallow: / and finally the Sitemap line.
In the first group Disallow has no value (allow all); in the AI groups it is followed by a slash (block all).
AI crawlers the Block AI training crawlers option adds
Ticking the box writes a User-agent group with Disallow: / for each of these twelve names. They do not all do the same job, so read the last column before blocking them wholesale.
| User-agent | Operator | What it is used for |
|---|---|---|
| GPTBot | OpenAI | Collects pages for training OpenAI models |
| ChatGPT-User | OpenAI | Fetches a page when a ChatGPT user asks for it; not a training crawler |
| OAI-SearchBot | OpenAI | Builds the index behind ChatGPT search results; not a training crawler |
| ClaudeBot | Anthropic | Collects pages for training Claude models |
| Claude-Web | Anthropic | Older Anthropic agent name, kept for coverage |
| anthropic-ai | Anthropic | Older Anthropic agent name, kept for coverage |
| CCBot | Common Crawl | Builds the open Common Crawl dataset, which many AI projects train on |
| Google-Extended | A control token, not a separate bot: opts the site out of Gemini training without affecting Google Search | |
| PerplexityBot | Perplexity | Indexes pages so Perplexity can cite them in answers |
| Applebot-Extended | Apple | A control token: opts the site out of Apple's AI training while Applebot still crawls for search |
| Bytespider | ByteDance | ByteDance's crawler, associated with model training |
| Meta-ExternalAgent | Meta | Collects pages for Meta's AI products |
The option is all or nothing. If you want to stay visible in ChatGPT search or Perplexity answers, delete the OAI-SearchBot, ChatGPT-User and PerplexityBot groups from the output before uploading it. Operators add and rename agents often, so check their documentation for names not on this list.
Robots.txt directives and who supports them
| Directive | What it does | Support |
|---|---|---|
| User-agent | Starts a group and names the crawler it applies to; * means any crawler | All crawlers that read robots.txt |
| Disallow | A path prefix the crawler should not fetch. Empty means nothing is blocked; / means everything is | All |
| Allow | An exception inside a disallowed path | Google, Bing and other crawlers following RFC 9309 |
| * and $ in paths | * matches any run of characters; $ anchors the end of the URL | Google and Bing; not guaranteed elsewhere |
| Sitemap | Full URL of a sitemap or sitemap index. Sits outside the groups and can be repeated | Google, Bing and most search engines |
| Crawl-delay | Seconds a crawler should wait between requests | Bing and some others; ignored by Google |
| Host | Names a preferred domain. A non-standard line introduced by Yandex | Ignored by Google and Bing |
| # comment | Everything after # on a line is ignored | All |
Noindex is not a robots.txt directive. Google stopped acting on Noindex lines in robots.txt in 2019.
How crawlers choose which rules to follow
A crawler reads the file, finds the one group whose User-agent line matches it most specifically, and follows only that group. This matters when you add AI rules. GPTBot, seeing a group addressed to GPTBot, obeys that group and ignores everything under User-agent: *. The groups this generator writes for AI crawlers contain only Disallow: /, so that is the complete rule set for those bots.
Inside a group, order does not matter. For Google and Bing the rule with the longest matching path wins, and if an Allow and a Disallow match equally, Allow wins. That is why Allow: /wp-admin/admin-ajax.php overrides Disallow: /wp-admin/ wherever the two lines sit. The generator lists Allow lines first purely so the exceptions are easy to spot.
Paths are matched from the start of the URL path and are case-sensitive. Disallow: /cart blocks /cart, /cart/ and /cart-items alike, because it is a prefix. Add a trailing slash, /cart/, to limit the rule to the folder. Query strings are part of the match, which is what makes a rule such as /*?sessionid= work.
Mistakes that cause real damage
- Leaving Disallow: / in place after launch. It is the standard staging rule and the most common reason a new site never appears in search. Check the live file on launch day.
- Disallowing a page you want removed from search. The crawler can no longer fetch it, so it never sees your noindex tag and the URL can stay listed. Allow crawling and use noindex.
- Blocking CSS and JavaScript folders. Search engines render pages; if they cannot load your styles and scripts they may judge the page as broken or not mobile friendly.
- Listing secret paths. The file is public, so Disallow: /internal-reports/ tells everyone where to look. Protect private areas with a login.
- Assuming one file covers every subdomain. www.example.com, example.com and shop.example.com are separate hosts and each serves its own file.
- Forgetting the trailing slash. Disallow: /blog also blocks /blog-archive and /blogroll.
What this generator does not do
- Separate rules per search engine. All your paths go under User-agent: *; there is no way to give Googlebot or Bingbot a group of its own. Add those groups by hand after downloading.
- Choosing individual AI crawlers. The tick box adds all twelve or none.
- More than one sitemap. The Sitemap URL box produces a single line; add further Sitemap lines to the file yourself.
- Testing. It does not fetch your site or check whether a given URL would be blocked. After uploading, open the file in a browser and check it in your search engine's webmaster tools.
- Validation of paths. Lines are written as typed, apart from adding a leading slash, so check wildcards and spelling.
Step by step
- 1
Set Default policy. Allow all crawlers, then add exceptions is right for a live site. Block all crawlers entirely writes Disallow: / and is meant for staging or internal sites.
- 2
In Paths to disallow, enter one path per line, such as /admin/ or /*?sessionid=. A missing leading slash is added for you.
- 3
In Paths to allow, add any exceptions inside a disallowed folder, such as /wp-admin/admin-ajax.php.
- 4
Enter your Sitemap URL in full, including https://. Leave Preferred host blank unless you specifically need a Host line.
- 5
Tick Block AI training crawlers if you want the twelve AI user-agent groups added, and set Crawl delay above 0 only if you need the directive.
- 6
Copy or download the robots.txt output and upload it so that it loads at https://yourdomain/robots.txt.