Skip to content

Robots.txt generator

Rules per crawler, AI crawler presets, sitemaps and a path tester that matches like Google.

Updated

Start from a preset

The AI presets add a group with Disallow: / for GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot, meta-externalagent (training) or OAI-SearchBot, Claude-SearchBot, PerplexityBot (AI search answers). Search engines like Googlebot and Bingbot aren't affected.

Group 1
Separate several with commas. * means every crawler without its own group.

Test a URL path

Allowed

Googlebot may crawl /. It follows the User-agent: * group; no rule matches this path.

How to create a robots.txt file

  1. Start from a preset, or edit the group for * (every crawler without its own group).
  2. Add Disallow rules for paths crawlers shouldn't fetch, and Allow rules for exceptions inside them.
  3. Add groups for specific crawlers, such as the AI crawlers below, and your sitemap URLs.
  4. Test real paths with the tester: it says whether a crawler may fetch each one, and which line decided.
  5. Download the file and upload it to the root of your site, so it's at https://yoursite.com/robots.txt.

How Google matches rules

A crawler follows only one group: the one naming it most specifically, or * if none does. Groups for the same crawler are merged. Within the group, the rule with the longest path that matches the URL wins, and when an Allow and a Disallow are the same length, Allow wins. Paths are case-sensitive; user-agent names aren't.

RulesPathResult
Allow: /p, Disallow: //pageAllowed: /p is longer
Allow: /folder, Disallow: /folder/folder/pageAllowed: a tie goes to Allow
Allow: /page, Disallow: /*.htm/page.htmBlocked: /*.htm is longer
Allow: /$, Disallow: //Allowed: $ matches the root only
Allow: /$, Disallow: //page.htmBlocked
Disallow: /*.php$/index.php?x=1Allowed: $ means the URL ends there

* matches any run of characters and $ marks the end of the URL. These examples come from Google's documentation, and the tester above gives the same answers.

AI crawler user agents

These are the robots.txt tokens each company documents. Training crawlers collect content that may be used to train AI models; AI search crawlers find pages to show and link in AI search answers, so blocking them can keep your site out of those answers. Robots.txt is a request these companies say they honour, not a technical block.

TokenCompanyUsed forDocumentation
GPTBotOpenAIAI training. Crawls content that may be used to train OpenAI's models.Overview of OpenAI crawlers
ClaudeBotAnthropicAI training. Collects content that may contribute to training Claude.Does Anthropic crawl data from the web, and how can site owners block the crawler?
Google-ExtendedGoogleAI training. Controls use for Gemini training and grounding; not a separate crawler and no effect on Google Search.Google's common crawlers (Google-Extended)
Applebot-ExtendedAppleAI training. Opts out of training Apple's foundation models; doesn't crawl or affect search.About Applebot
CCBotCommon CrawlAI training. Builds Common Crawl's free web archive, which anyone can download, AI developers included.CCBot
meta-externalagentMetaAI training. Crawls for training Meta's AI models and indexing content.Meta Web Crawlers
OAI-SearchBotOpenAIAI search. Finds and links websites in ChatGPT search.Overview of OpenAI crawlers
Claude-SearchBotAnthropicAI search. Improves search results in Claude.Does Anthropic crawl data from the web, and how can site owners block the crawler?
PerplexityBotPerplexityAI search. Surfaces and links websites in Perplexity answers; not used to train foundation models.Perplexity Crawlers

Each link was checked on 7 October 2026. Companies add and rename crawlers, so check their pages before relying on this list. Blocking Google-Extended doesn't affect how your site appears in Google Search.

What robots.txt can't do

  • Hide a page from Google. A blocked URL can still be indexed if other sites link to it. Use a noindex robots meta tag, and leave the page crawlable so Google can see it.
  • Protect private content. The file is public and obeying it is voluntary. Use a password for anything private.
  • Slow Googlebot down. Google ignores crawl-delay. Some other crawlers, such as Bingbot, read it.
  • Cover other hosts. A file applies only to its own protocol, host and port: www.example.com and example.com each need one.

Sources

Each link was last checked on .

Common uses

  • Opting out of AI training. Use the AI preset to add GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot and Meta's crawler with Disallow: /, while search engines keep crawling as before.
  • Keeping crawlers out of admin and cart pages. Disallow folders like /admin/ or /cart/ for all crawlers, then test a few real URLs to be sure product pages stay allowed.
  • Checking a rule before it goes live. Type a path and a crawler and the tester says whether it's allowed and which line decided, so a stray Disallow: / never blocks the whole site.

Questions

Where does robots.txt go?

In the root of the host, at https://example.com/robots.txt. Crawlers only look there, and each subdomain and protocol needs its own file.

Does Disallow keep a page out of Google?

Not reliably. Disallow stops crawling, but a blocked URL can still be indexed if other sites link to it. To keep a page out of results, let it be crawled and add a noindex robots meta tag instead.

Which rule wins when Allow and Disallow both match?

For Google, the rule with the longest path wins, counting wildcards as characters. If an Allow and a Disallow are the same length, Allow wins. The path tester applies exactly this.

How do I block AI crawlers?

Add a group for each crawler's documented token, such as GPTBot, ClaudeBot or Google-Extended, with Disallow: /. Blocking Google-Extended doesn't affect Google Search. Robots.txt is a request that these companies say they follow, not a lock.

Does Google support crawl-delay?

No, Google ignores it. Some other crawlers, such as Bingbot, read it as the number of seconds to wait between requests.

All SEO tools →