Block GPTBot but allow ChatGPT search: robots.txt recipes

Six copy-paste robots.txt recipes for AI crawlers, including how to block OpenAI training while keeping your pages in ChatGPT search answers.

To block GPTBot but remain in ChatGPT search, put GPTBot in one group with Disallow: / and OAI-SearchBot in a separate group with Allow: /. OpenAI’s bot settings are independent: one controls training, the other controls whether your pages can appear in ChatGPT search answers. Neither change touches Googlebot. The token table and the explanation are in GPTBot is not ChatGPT search; this page is the recipe book.

Six recipes follow. Each gives the goal, the exact file, the effect per token, what it costs, and the mistake that breaks it. All token behaviour comes from the vendor documentation linked in Sources. Test the served file, not the copy in your repository, because Cloudflare and some hosts can change what a crawler receives.

Goal: opt out of OpenAI training without losing ChatGPT search visibility.

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Allow: /

Per token: GPTBot is the training crawler. OpenAI documents the disallow as the signal that content should not be used in training generative AI foundation models. OAI-SearchBot is the search crawler, and an explicit allow keeps the site eligible for ChatGPT search answers. ChatGPT-User acts on user requests and may ignore robots.txt, and OAI-AdsBot only visits pages submitted as ads; OpenAI’s documentation does not say whether OAI-AdsBot follows robots.txt.

Cost: content is excluded from OpenAI training. Search eligibility stays.

Gotcha: if your file already has a User-agent: * group with Disallow: lines, a new OAI-SearchBot group does not inherit them. Allow: / gives OAI-SearchBot a clean slate while every unnamed crawler still follows the global group. Copy the paths you care about into the named group, as in recipe 6. OpenAI also says search results can take about 24 hours to reflect a robots.txt update, so do not judge the change from the next hour of logs.

Goal: no training from the major operators, maximum AI search visibility.

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Applebot-Extended
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Meta-ExternalAgent
Disallow: /

Per token:

Token What it controls
GPTBot OpenAI training
ClaudeBot Anthropic training
Google-Extended Gemini training and grounding
Applebot-Extended Apple training, no crawling
CCBot Common Crawl
Meta-ExternalAgent Meta training and direct indexing

Google-Extended covers training for future Gemini models plus grounding in Gemini Apps and Grounding with Google Search on Vertex AI. It is a control token, not a separate crawler. Applebot-Extended does not crawl pages. Meta-ExternalAgent crawls for training and for indexing content directly into Meta products.

Still allowed: OAI-SearchBot for ChatGPT search, Claude-SearchBot for Anthropic search indexing, PerplexityBot for Perplexity search, Meta-WebIndexer for Meta AI search, plus Applebot and Googlebot for ordinary search.

Cost: you give up training use across those operators and keep search. Google states that Google-Extended does not impact a site’s inclusion in Google Search nor is it used as a ranking signal there. Apple states that pages disallowing Applebot-Extended can still be included in search results.

Gotcha: Anthropic asks you to repeat the opt-out for every subdomain you want excluded. A rule on example.com is not a rule on blog.example.com. Naming Google-Extended also does not block Googlebot; they are separate controls.

Recipe 3: allow AI search on part of the site

Goal: let AI search quote the blog, keep it out of the app.

User-agent: OAI-SearchBot
Disallow: /
Allow: /blog/

User-agent: PerplexityBot
Disallow: /
Allow: /blog/

User-agent: GPTBot
Disallow: /

Per token: the Disallow: / closes the whole host; Allow: /blog/ reopens that path. Under RFC 9309 and Google’s spec the most specific (longest) matching rule wins, so /blog/post matches the longer allow and is permitted, while /app/dashboard matches only the disallow and is blocked. GPTBot stays blocked everywhere, so training is off across the site.

Cost: pages outside /blog/ are not eligible for those AI search answers. Training is off everywhere.

Gotcha: a later private path under the allowed directory inherits the allow. Add a longer Disallow: /blog/drafts/ to close it, because the longer path wins. Do not use robots.txt to protect customer data; it is a crawl request, not access control.

Goal: keep AI crawlers and AI search off the site.

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Claude-SearchBot
Disallow: /

User-agent: Claude-User
Disallow: /

User-agent: PerplexityBot
Disallow: /

User-agent: Perplexity-User
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Applebot-Extended
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Meta-ExternalAgent
Disallow: /

Per token: every named AI token above is closed. Googlebot and ordinary search crawlers are not in the list and are unaffected. Google-Extended does not affect Google Search anyway.

Cost: opting out of OAI-SearchBot means the site will not be shown in ChatGPT search answers, though OpenAI says it can still appear as navigational links. PerplexityBot is documented as a search crawler, so blocking it removes that search route. You also lose all the training and grounding uses listed in recipe 2.

Gotcha: three user-initiated fetchers may ignore the file. OpenAI says ChatGPT-User fetches are initiated by a user, so robots.txt rules may not apply. Perplexity says its user fetcher generally ignores robots.txt. Meta says Meta-ExternalFetcher may bypass robots.txt. A disallow is not a guarantee that no request happens, and it is not a security control. If you need enforcement at the edge, read the Cloudflare section below.

Recipe 5: keep everything open, exclude a private path

Goal: allow all crawlers, including AI, but keep private paths out.

User-agent: *
Disallow: /private/
Disallow: /checkout/

Per token: no AI token is named, so every crawler without its own group reads these two disallows and nothing else. This is the lowest-maintenance policy.

Cost: none for AI visibility.

Gotcha: user-initiated fetchers may still fetch a private path because the request came from a user. Do not put anything sensitive behind robots.txt alone. If you add a named AI group later, it will not inherit these disallows, which is the next recipe.

Recipe 6: add AI rules to a file that already has a global group

Goal: change one operator’s policy without silently dropping the rest of your rules.

Before:

User-agent: *
Disallow: /cart/
Disallow: /search/

After:

User-agent: *
Disallow: /cart/
Disallow: /search/

User-agent: GPTBot
Disallow: /

User-agent: OAI-SearchBot
Disallow: /cart/
Disallow: /search/
Allow: /

Per token: GPTBot’s Disallow: / already covers every path, so copying lines into that group adds nothing. OAI-SearchBot has a narrower policy, so the two disallows are repeated. Google’s spec is explicit: “User agent specific groups and global groups (*) are not combined.” The named group is the only group that applies to that crawler. Group order is irrelevant, and multiple groups for the same user agent are merged internally.

Cost: none, if the copy is complete.

Gotcha: the common mistake is to add User-agent: OAI-SearchBot with Allow: / and stop there. That removes /cart/ and /search/ from the only group OAI-SearchBot reads, so the paths you meant to block become crawlable for that crawler. Every named group needs the relevant global disallows copied into it.

Apple has its own inheritance case. If robots.txt does not mention Applebot but mentions Googlebot, Applebot follows the Googlebot rules. Applebot does not follow crawl-delay. A Googlebot group written for one purpose can therefore change Applebot’s behaviour too.

The layer above robots.txt: Cloudflare

If the site is behind Cloudflare, the file on your origin is not necessarily the file a crawler receives. “Cloudflare will prepend our managed robots.txt before your existing robots.txt, combining both into a single response.” The managed block appears only when Enable Bot Preference Sync is on and at least one Search, Agent or Training policy is set to Block or Disallow. It is available on all plans.

The example block starts with Content-signal: search=yes, ai-train=no, use=reference and disallows Amazonbot, Applebot-Extended, Bytespider, CCBot, ClaudeBot, Google-Extended, GPTBot and meta-externalagent. Content Signals has three categories: “search (building a search index), ai-input (feeding content into AI models for real-time answers), and ai-train (training or fine-tuning AI models).”

Two practical consequences. First, the managed block and your file can both contain a User-agent: * group, so the response has two global groups. Google’s spec merges groups for the same user agent and ignores their order, so Google’s crawlers read the two as one group. That is fine if the policies agree; check the combined result, not each half. Second, Google says Search Console “may occasionally report Syntax not understood for Content Signals and newer directives”, so a syntax warning on the Content-signal line is not proof that your Disallow lines are broken.

The settings that generate the managed block live in Cloudflare’s bot configuration, not in your repository. If a client says they blocked a bot in Cloudflare and the file looks clean, check the served response with a bot user agent. For client sites, monitor the served robots.txt on a schedule. stillindexed reads it hourly and confirms a new block on a monitored URL with a second read about five minutes later before it alerts, which catches a change made in Cloudflare or by a plugin, not only a commit.

If a page has already dropped out

Fix the policy first, then check whether the page is blocked at another layer. The operator-specific guides cover the common cases: OpenAI AI crawler blocked, Perplexity AI crawler blocked, Google-Extended AI crawler blocked and Cloudflare AI crawler blocked. For the wider picture of what each crawler fetches and why a clean robots.txt is not the only requirement, read how AI crawlers see your site.

Test each recipe

Test against the served file, not the copy in your repository. The robots.txt tester checks up to 100 URLs against the live file or a draft you paste, for 11 crawlers including GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, PerplexityBot, Google-Extended and CCBot, and shows the rule that decided each verdict, which is the fastest way to catch the named-group trap. It also diffs a proposed file against the live one, listing only the verdicts that flip. The AI crawler checker resolves the robots.txt verdict for a URL per AI bot and probes the edge with each search bot’s user agent.

A raw check with curl:

curl -s https://example.com/robots.txt

curl -A "GPTBot/1.4" -s -o /dev/null -w "%{http_code}\n" https://example.com/blog/post

The first command shows what the server returns, including any Cloudflare prefix. The second shows whether your edge answers a request that claims to be GPTBot; robots.txt controls crawling, not whether the URL returns 200. A spoofed user agent tests your own edge rules, not what OpenAI’s verified crawler receives. Replace the path with one you actually monitor.

Two timing notes. OpenAI says search results can take about 24 hours to reflect a robots.txt change, and it may tag robots.txt requests with an additional marker in the user agent, so a log line that does not match GPTBot/1.4 exactly is not automatically a different bot. Perplexity says changes can take up to 24 hours, and Meta says crawlers may cache robots.txt for up to 24 hours. Do not re-edit the file every hour because the first crawl still used the old rules.

Sources

Questions

Does blocking GPTBot remove my site from ChatGPT search?
No, provided OAI-SearchBot is still allowed. OpenAI's settings are independent, so a site can disallow GPTBot for training while allowing OAI-SearchBot for search. OpenAI says search results can take about 24 hours to reflect a robots.txt change, so allow a day before judging the result.
Does blocking Google-Extended remove my pages from Google Search?
No. Google states that Google-Extended does not impact a site's inclusion in Google Search and is not a ranking signal there. It is a control token for Gemini training and grounding, not a separate crawler, so Googlebot still crawls and indexes the page normally.
Does blocking ClaudeBot cover every subdomain?
No. Anthropic asks site owners to repeat the opt-out for every subdomain they want excluded. A ClaudeBot disallow on example.com does not automatically apply to blog.example.com or shop.example.com. Check the robots.txt served on each host and confirm the ClaudeBot group is present.
Does a named user-agent group inherit the User-agent * rules?
No. Under Google's robots.txt spec, user agent specific groups and global groups are not combined, and a crawler follows only its most specific matching group. If a named group has its own policy, copy the important Disallow lines into it or those paths become allowed for that crawler.
How long do AI crawlers take to respect a robots.txt change?
OpenAI says search results can take about 24 hours to reflect a robots.txt update. Perplexity says changes can take up to 24 hours. Meta says crawlers may cache robots.txt for up to 24 hours. Check the served file first, then wait before editing again.