Skip to content

robots.txt for AI crawlers: copy-paste templates (2026)

Four robots.txt templates for AI crawlers using each vendor's exact tokens, plus the RFC 9309 grouping rules, the mistakes we see most and how to test it.

By the Do My AEO team. , 7 min read

A robots.txt for AI crawlers is a set of groups that name each vendor's bot by its exact token, such as OAI-SearchBot, GPTBot, ClaudeBot or Google-Extended, and allow or disallow paths for it. The four templates below cover the common choices: allow everything, allow AI search but block training, block all AI use, or open only selected paths. Each bot obeys only the most specific group that names it.

Robots.txt is a request, not a lock. It tells well-behaved crawlers what you want, and some user-initiated fetchers say openly that they may not follow it. Treat the templates as your stated policy, then check your CDN or firewall enforces nothing that contradicts it.

The tokens, from each vendor's own docs

Every token below comes from the vendor's documentation (checked November 19, 2026). Tokens are matched case-insensitively, but copy them exactly anyway.

Vendor Token Job Follows robots.txt?
OpenAI OAI-SearchBot ChatGPT search results Yes
OpenAI GPTBot Content that may train OpenAI's models Yes
OpenAI ChatGPT-User Visits a page when a user asks "robots.txt rules may not apply"
Anthropic Claude-SearchBot Indexes for Claude's search results Yes
Anthropic ClaudeBot Content that may train Anthropic's models Yes
Anthropic Claude-User Retrieves pages when a user asks Claude Yes, per Anthropic
Perplexity PerplexityBot Perplexity search results; not used for training Yes
Perplexity Perplexity-User Fetches a page when a user asks "generally ignores" robots.txt
Google Googlebot Google Search, including AI Overviews and AI Mode Yes
Google Google-Extended Control token for Gemini training and grounding; does not crawl Yes
Apple Applebot Search in Spotlight, Siri and Safari Yes
Apple Applebot-Extended Control token for Apple model training; does not crawl Yes
Common Crawl CCBot Open web archive that anyone can download Yes
Microsoft Bingbot Bing search; Microsoft's AI preferences are set per page or via the shared training token Yes

Two of these are not crawlers at all. Google says Google-Extended "doesn't have a separate HTTP request user agent string" and is used "in a control capacity". Apple says "Applebot-Extended does not crawl webpages" and only decides how Applebot's data is used. You still write them as normal groups.

For a closer look at Anthropic's three bots, see ClaudeBot, Claude-SearchBot and Claude-User explained.

How robots.txt groups work (RFC 9309)

The standard is RFC 9309. Five rules explain nearly every surprise:

  1. A named group replaces *, it does not add to it. A crawler obeys the group that matches its token. Only "if no matching group exists" does it fall back to User-agent: *. If you give GPTBot its own group, nothing you wrote under * applies to GPTBot any more.
  2. Groups naming the same bot are merged. Two separate User-agent: ClaudeBot groups are combined into one.
  3. One group can name many bots. A group is "one or more user-agent lines" followed by rules, so you can stack tokens and write the rules once.
  4. The longest matching path wins. Allow: /blog/ beats Disallow: / for /blog/post, because it has more characters. On a tie, Allow should win. $ marks the end of a path.
  5. Error codes change the meaning. A 4xx response for robots.txt means a crawler "MAY access any resources". A 5xx response means it "MUST assume complete disallow".

The file must live at /robots.txt on each host, so blog.example.com needs its own. Anthropic's help article says the same for opting out of its bots on subdomains.

Template 1: allow everything

User-agent: *
Allow: /
Disallow: /admin/

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

This lets every crawler in, including training crawlers. It is a fine default if you want maximum reach and your content is marketing rather than the product. Make sure no other group names an AI bot, or rule 1 above applies.

Template 2: allow AI search, block AI training

# Search and user-requested fetches: allowed
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
Allow: /
Disallow: /admin/

# Training crawlers and training control tokens: blocked
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Applebot-Extended
Disallow: /

# Optional. Also opts out of grounding in Gemini Apps, not only training.
# User-agent: Google-Extended
# Disallow: /

# Shared "no AI training" preference (IETF draft, see below)
User-agent: __usage_ai-training
Disallow: /

# Everyone else, including Googlebot, Bingbot and Applebot
User-agent: *
Allow: /
Disallow: /admin/

Notice that /admin/ appears twice. That is rule 1 at work: the named search group would otherwise be allowed into /admin/.

Google-Extended is commented out on purpose. Google says it governs training of future Gemini models and "grounding" in Gemini Apps and Grounding with Google Search on Vertex AI. Blocking it is not a pure training opt-out, so decide whether Gemini app answers matter to you first. It does not touch AI Overviews or AI Mode; Google's AI features page says robots.txt directives for Googlebot are the control there.

Template 3: block everything AI

User-agent: GPTBot
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: ClaudeBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /

User-agent: __usage_ai-training
Disallow: /

User-agent: *
Allow: /

This keeps Googlebot, Bingbot and Applebot, so you stay in regular search. Three limits apply. OpenAI says of ChatGPT-User that "robots.txt rules may not apply", and Perplexity says Perplexity-User "generally ignores robots.txt rules", so enforcing those needs a firewall rule using their published IP lists. Google's AI Overviews and AI Mode cannot be blocked without blocking Googlebot. Microsoft's AI answers in Bing and Copilot draw on content its crawlers collect, and its grounding opt-out is a page-level tag, not a robots.txt group. Before choosing this template, read should you block AI crawlers?

Template 4: open only a specific path set

User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
Allow: /blog/
Allow: /docs/
Allow: /pricing$
Allow: /$
Disallow: /

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
Allow: /press/
Disallow: /

User-agent: *
Allow: /
Disallow: /admin/

Here AI search bots see the home page, blog, docs and pricing page only. Training crawlers see only the press section. Because the longest match wins, /blog/ (6 characters) beats / (1 character). The $ stops /pricing from also opening /pricing-internal.

The new shared training signal, and Cloudflare's Content-Signal

__usage_ai-training is a policy token from an IETF Internet-Draft, draft-kelley-aipref-training-preference-signal-01, published November 16, 2026. It reuses normal robots.txt groups, and the draft says User-Agent: * groups "MUST NOT be interpreted as matching the policy token". It is a preference about use, not a crawl rule. Support so far, from first-party pages:

  • Anthropic says it began recognizing the signal on October 30, 2026, is rolling it out over time, and treats rules naming ClaudeBot as taking priority.
  • Microsoft says it will honor it as it crawls from February 1, 2027 (Bing blog).
  • Google says it "intends to support" it in early 2027.

OpenAI's crawler page does not mention it, so keep the GPTBot group.

Cloudflare's managed robots.txt can add a line such as Content-signal: search=yes, ai-train=no, use=reference under User-Agent: *, with categories search, ai-input and ai-train. Cloudflare describes use= as an extension it is testing. None of the vendor pages we checked say they read Content-signal, so treat it as an extra statement, not a replacement for the named groups.

Common mistakes

  • Named group, forgotten private paths. Adding User-agent: GPTBot with Allow: / silently drops your * disallows for GPTBot.
  • Pasted "block AI" lists that include search bots. OpenAI says sites opted out of OAI-SearchBot "will not be shown in ChatGPT search answers".
  • Blocking Googlebot or Bingbot to stop AI. That removes you from search itself.
  • Expecting Google-Extended to remove AI Overviews. Google says it "does not impact a site's inclusion in Google Search".
  • The Applebot fallback. Apple says that if robots.txt does not mention Applebot but mentions Googlebot, Applebot follows the Googlebot rules.
  • A robots.txt that returns 5xx. Under RFC 9309 that means complete disallow for everyone.
  • Blocking IPs instead. Anthropic warns this "may not work correctly" because its bots can no longer read your robots.txt.
  • Old Anthropic tokens. Anthropic's current article lists only ClaudeBot, Claude-User and Claude-SearchBot. Lines for anthropic-ai or Claude-Web in older lists are not in that article.

How to test it

  1. Run curl -sI https://example.com/robots.txt and confirm a 200 status and a text/plain content type.
  2. Read each AI bot's group by hand using the five rules above. Ask: which group names this token, and what is the longest matching path for my key URLs?
  3. In Google Search Console, the robots.txt report shows which robots.txt files Google found, when they were last crawled and any parsing errors.
  4. Check your logs for each token and verify the IP against the vendor's list: openai.com/searchbot.json, perplexity.ai/perplexitybot.json, claude.com/crawling/bots.json, index.commoncrawl.org/ccbot.json, and Apple's Applebot list.
  5. Wait about a day. OpenAI and Perplexity both say changes can take up to 24 hours.

Our free scan reads your robots.txt for 14 AI and search crawlers and reports which ones are blocked.

Sources

Frequently asked questions

Does a User-agent: * rule apply to AI crawlers?+

Only to crawlers that have no group of their own. Under RFC 9309 a crawler that finds a group naming it obeys that group and ignores the * group entirely, so private paths listed under * must be repeated in any named group.

Can I block AI training but stay in AI search answers?+

Yes, for the vendors that separate the two. Allow OAI-SearchBot, Claude-SearchBot and PerplexityBot, and disallow GPTBot, ClaudeBot, CCBot and Applebot-Extended. Google is the exception: AI Overviews and AI Mode are controlled by Googlebot, not by Google-Extended.

Does blocking Google-Extended remove me from AI Overviews?+

No. Google says Google-Extended does not affect inclusion in Google Search, and that robots.txt rules for Googlebot are the control for AI features in Search. Google-Extended covers Gemini model training and grounding in Gemini Apps and Vertex AI.

How long do robots.txt changes take to apply?+

OpenAI says about 24 hours for its search systems and Perplexity says up to 24 hours. RFC 9309 says crawlers should not use a cached robots.txt for more than 24 hours unless the file is unreachable.