Skip to content

How to Block GPTBot and Other AI Scrapers in robots.txt

Copy-ready robots.txt blocks for three goals: stop AI training but stay in AI search, block every AI bot, or block just a few. Plus what robots.txt cannot do and whether blocking Google-Extended affects your Google rankings.

6 min readBy Admin

How to Block GPTBot and Other AI Scrapers in robots.txt

Short answer: add these two lines to the robots.txt file at the root of your site: User-agent: GPTBot and Disallow: /. That tells OpenAI's training crawler to stay out, while ChatGPT search (which uses a different bot, OAI-SearchBot) can still read and cite you. For a full file that handles a dozen AI bots, copy one of the blocks below or build your own with our free AI robots.txt generator.

Training bots, search bots and user-triggered bots

Every major AI company now runs separate bots for separate jobs, and robots.txt treats each one separately:

TypeWhat blocking it doesTokens (as of November 2026)
TrainingAsks the company not to use your pages to train modelsGPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot, Meta-ExternalAgent
AI searchRemoves your pages from that AI search product, so no citations or linksOAI-SearchBot, Claude-SearchBot, PerplexityBot
User-triggeredStops the assistant from opening your page when a user asks it toChatGPT-User, Claude-User, Perplexity-User

Sources: OpenAI crawlers, Anthropic crawlers, Perplexity bots, Google crawlers, Applebot, Meta crawlers and Common Crawl. Bot names change, so check these pages once or twice a year.

This is what most publishers want: no free training data, but still eligible to be cited in ChatGPT, Claude and Perplexity answers.

# Block AI training
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: CCBot
User-agent: Meta-ExternalAgent
User-agent: Bytespider
Disallow: /

# Allow AI search and user-requested fetches
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
Allow: /

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

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

Several User-agent lines in a row share the rules below them; that is valid under the robots.txt standard (RFC 9309). Bytespider is ByteDance's crawler; ByteDance does not publish a documentation page for it that we could verify, so treat that line as a request only.

A bot that has its own group ignores the User-agent: * group. If you disallow private paths such as /admin/ for everyone, repeat those Disallow lines inside the "Allow AI search" group too, or the named bots will not see them.

Option 2: block every AI bot

If you do not want any AI company to fetch your pages, for training or for answers, put all of them in one group:

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: Google-Extended
User-agent: Applebot-Extended
User-agent: CCBot
User-agent: Meta-ExternalAgent
User-agent: Bytespider
Disallow: /

User-agent: *
Allow: /

The cost: you will not be linked or cited in ChatGPT search, Claude or Perplexity answers. Leave Googlebot and Bingbot alone unless you also want to leave Google and Bing search.

Option 3: block only some bots or some folders

Just OpenAI training:

User-agent: GPTBot
Disallow: /

Keep training bots out of paid or premium content but let them read the rest:

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
Disallow: /members/
Disallow: /premium/

Slow a crawler down instead of blocking it. Anthropic says it supports the non-standard Crawl-delay rule (in seconds); Google ignores it.

User-agent: ClaudeBot
Crawl-delay: 5

Writing these by hand for 15 bots is error-prone. Our robots.txt generator for AI bots lets you switch each crawler on or off (or pick a preset such as "allow citations, block training"), add your private paths and sitemap, and builds the file in your browser, repeating the private-path rules in every named group for you.

Does blocking Google-Extended hurt your Google rankings?

No. Google says Google-Extended "does not impact a site's inclusion in Google Search". It is a robots.txt token only, with no crawler of its own, and it controls whether Google may use your content to train Gemini models and for grounding in the Gemini apps and Vertex AI.

What it does not do is remove you from AI Overviews or AI Mode. Those are part of Google Search and use Googlebot. Google's AI features guide says the controls there are the nosnippet, data-nosnippet, max-snippet and noindex rules, which also affect your normal search snippets. Google also says it intends to support a shared AI-training preference signal in robots.txt in early 2027.

Apple is similar: it says pages that disallow Applebot-Extended can still appear in its search results and the rule is not used for ranking.

robots.txt is voluntary: when to use a firewall instead

RFC 9309 says plainly that robots.txt rules are not a form of access authorization. The big AI companies say their crawlers follow it, but:

  • User-triggered bots may skip it. OpenAI says robots.txt "may not apply" to ChatGPT-User, Perplexity says Perplexity-User "generally ignores" it, and Meta says its external fetcher may bypass it.
  • Any scraper can lie about its user agent or ignore the file entirely.
  • robots.txt is public, so listing a secret folder in it points people straight to it.

If you need a hard block, use a WAF or CDN rule that returns 403 to the bot. Cloudflare has per-category AI crawler policies (Search, Agent and Training), and most hosts and security plugins can block by user agent. Vendors publish their IP ranges (for example openai.com/gptbot.json) so you can verify real bots. For anything private, use a login.

Check that it worked

Open https://yoursite.com/robots.txt to confirm the live file has your rules (plugins and hosts sometimes override it), and allow about 24 hours: OpenAI and Perplexity both say changes can take that long. Then follow how to check if AI bots can crawl your site, or run the AI Crawler Checker to see each bot's robots.txt result and live response side by side.

FAQ

How do I block GPTBot in robots.txt?

Add User-agent: GPTBot on one line and Disallow: / on the next, in the robots.txt at your site root. OpenAI says disallowing GPTBot means your content should not be used to train its foundation models.

Yes. Disallow GPTBot and allow OAI-SearchBot. OpenAI controls them separately, and the same split exists at Anthropic (ClaudeBot vs Claude-SearchBot).

Does blocking GPTBot remove content OpenAI already collected?

No. robots.txt only affects future crawling. It does not delete anything already gathered.

Should I block Googlebot to stay out of AI Overviews?

Only if you are willing to leave Google Search entirely, because AI Overviews use the same crawler. Snippet controls such as nosnippet are the narrower option.

What is the robots.txt name for Gemini?

Google-Extended. It only controls Gemini training and grounding; it does not affect Google Search.

Pick the option that matches your goal, paste it into your robots.txt, or let the free AI crawler robots.txt generator build and download the file for you.

Related Articles

Try Our Smart Tools

Put what you've learned into practice with our free AI, SEO and developer tools.