Robots.txt Generator
Build a robots.txt file with Allow and Disallow rules per crawler, sitemap lines and presets for blocking AI training bots. Copy or download it.
robots.txt · 5 lines · 96 B
User-agent: * Disallow: /admin/ Allow: /admin/public/ Sitemap: https://example.com/sitemap.xml
What this file does
- Every crawler may crawl everything except URLs starting with /admin/. /admin/public/ stays allowed because the longer matching rule wins.
- One sitemap is listed for any crawler that reads the Sitemap line.
robots.txt is a request, not access control: a crawler can ignore it, and a disallowed URL can still be indexed if other pages link to it. Upload the file to the root of the host it applies to, as /robots.txt.
The file is built in your browser. Your rules are not sent to our server.
01 · Definition
What is a robots.txt file?
robots.txt is a plain text file at the root of a website that tells crawlers which URLs they may request. It is defined by RFC 9309 and made of groups: one or more User-agent lines followed by Allow and Disallow rules. It is a request to crawlers, not access control, and it does not remove pages from search results.
02 · Overview
How the Robots.txt Generator works
The tool builds a robots.txt from rule groups: pick the crawlers a group applies to, add Allow and Disallow paths, and list your sitemaps. Presets cover allowing everything, blocking everything, blocking the crawlers whose operators say they collect data for AI training, and the rules WordPress serves by default. Paths, user-agent tokens and sitemap URLs are validated as you type. A plain-English summary explains what the file does, and a checker tells you whether a given URL is allowed for a given crawler using the longest-match rule from RFC 9309. The file is built in your browser and is not sent to our server.
03 · Guide
How crawlers decide which rule applies
A crawler first looks for a group that names its own token, compared without regard to case. If one exists it follows only that group and ignores the * group. If none does, it follows the * group. If there is no * group either, nothing is restricted.
Inside the group, every Allow and Disallow path is compared with the start of the URL path, and paths are case-sensitive. The rule with the longest matching path wins. If an Allow and a Disallow match with the same length, Allow wins. * matches any run of characters and $ marks the end of the URL. The examples are from Google's documentation and give the same result in this tool's checker.
| Rules | URL path | Result | Why |
|---|---|---|---|
| Allow: /p and Disallow: / | /page | Allowed | /p is the longer match |
| Allow: /folder and Disallow: /folder | /folder/page | Allowed | Same length, Allow wins |
| Allow: /page and Disallow: /*.htm | /page.htm | Disallowed | /*.htm is the longer match |
| Allow: /$ and Disallow: / | /page.htm | Disallowed | /$ matches only the home page |
| Disallow: /fish | /Fish.asp | Allowed | Paths are case-sensitive |
04 · Guide
AI crawler user agents and what each one is for
Each row is taken from the operator's own documentation, read on 11 November 2026. The "Block AI training" preset disallows the six tokens marked Yes: the ones whose operators say the crawl may be used to train models. It leaves AI search crawlers and user-requested fetches alone, so a site can still be found and cited in AI answers.
Google-Extended and Applebot-Extended are not separate crawlers. They are tokens that control how pages already fetched by Googlebot and Applebot may be used, and both companies say that disallowing them does not affect search results. OpenAI and Perplexity say robots.txt may not apply to fetches a user asks for.
| Token | Operator | Used for | In preset |
|---|---|---|---|
| GPTBot | OpenAI | Content that may train models | Yes |
| ClaudeBot | Anthropic | Content that may train models | Yes |
| Google-Extended | Use of crawled pages for Gemini training | Yes | |
| Applebot-Extended | Apple | Use of crawled pages for Apple's models | Yes |
| Meta-ExternalAgent | Meta | Training AI models, indexing | Yes |
| Amazonbot | Amazon | Amazon products; may train models | Yes |
| OAI-SearchBot | OpenAI | ChatGPT search results | No |
| ChatGPT-User | OpenAI | Pages a user asks ChatGPT to open | No |
| Claude-SearchBot | Anthropic | Claude search results | No |
| Claude-User | Anthropic | Pages a user asks Claude to open | No |
| PerplexityBot | Perplexity | Perplexity search results | No |
05 · Use cases
When to use the Robots.txt Generator
- 01
Write the first robots.txt for a new site, with a Sitemap line
- 02
Keep crawlers out of admin, cart and internal search URLs
- 03
Opt out of AI training crawlers while staying visible in search
- 04
Check whether a URL is allowed for a crawler before deploying a rule change
06 · Examples
Robots.txt Generator examples
Preset: Allow all
ex 01User-agent: * Disallow: Sitemap: https://example.com/sitemap.xml
An empty Disallow matches nothing, so every crawler may fetch every URL. Replace the sitemap URL with your own.
Preset: Block AI training
ex 02User-agent: GPTBot User-agent: ClaudeBot User-agent: Google-Extended User-agent: Applebot-Extended User-agent: Meta-ExternalAgent User-agent: Amazonbot Disallow: / User-agent: * Disallow: Sitemap: https://example.com/sitemap.xml
One group disallows the whole site for six tokens. Every other crawler falls through to the * group, which allows everything.
Preset: WordPress
ex 03User-agent: * Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Sitemap: https://example.com/wp-sitemap.xml
The rules WordPress core generates. admin-ajax.php stays crawlable because its Allow path is longer than the Disallow path.
Check /admin/public/report.html for Googlebot against Disallow: /admin/ and Allow: /admin/public/
ex 04Allowed. No group names Googlebot, so the * group applies. Allow: /admin/public/ is the longest match, ahead of Disallow: /admin/.
The checker names the group that applied and the rule that won.
07 · FAQ
Robots.txt: frequently asked questions
Does robots.txt remove a page from Google?
Where does the robots.txt file go?
Which rule wins when Allow and Disallow both match?
Do crawlers with their own group also follow the * rules?
Does Google obey Crawl-delay?
How do I block AI crawlers with robots.txt?
What happens if robots.txt is missing or returns an error?
Are my rules sent to your server?
08 · Reference
Specs and further reading
These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.
- RFC 9309: Robots Exclusion Protocol
IETF. The standard: groups, user-agent matching, longest-match precedence, * and $, error handling, caching and the 500 KiB parsing limit.
- How Google interprets the robots.txt specification
Google Search Central. The fields Google supports, the path-matching and precedence examples used above, and its handling of HTTP errors.
- Introduction to robots.txt
Google Search Central. States that robots.txt manages crawler traffic and is not a way to keep a page out of Google.
- List of Google's common crawlers
Google Search Central. User-agent tokens for Googlebot, Googlebot-Image and Google-Extended.
- Overview of OpenAI Crawlers
OpenAI. What GPTBot, OAI-SearchBot and ChatGPT-User are each used for.
- Does Anthropic crawl data from the web, and how can site owners block the crawler?
Anthropic. ClaudeBot, Claude-User and Claude-SearchBot, and Anthropic's support for Crawl-delay.
- About Applebot
Apple. Applebot and Applebot-Extended, and the statement that Applebot does not follow crawl-delay.
- To crawl or not to crawl, that is BingBot's question
Bing Webmaster Blog. Bing's 2012 post on the bingbot group and Crawl-delay values of 1 to 30.
- do_robots()
WordPress Developer Resources. The source of the default rules behind the WordPress preset.
09 · More
Tools that pair with Robots.txt
Meta Tags Generator
Generate the SEO, Open Graph and Twitter Card meta tags for a page, with a link preview. An AI model can suggest the title and description from a brief.
UTM Link Builder
Add utm_source, utm_medium, utm_campaign and other UTM parameters to a URL. The tool keeps existing parameters and #fragments and encodes values.
.gitignore Generator
Pick from 21 stack templates or describe your project in plain English. Get a labelled, deduplicated .gitignore to copy or download.
Slug Generator
Convert a title into a URL slug as you type. Choose hyphen or underscore, case and a maximum length; accents become ASCII. One title per line for bulk.