SEO guide

How to Block AI Crawlers with robots.txt (GPTBot, ClaudeBot & More)

Which AI bots to block and which to allow: copy-ready robots.txt rules for GPTBot, ClaudeBot, Google-Extended, CCBot and more, without hurting Google rankings.

AI companies crawl the web for two different reasons: to collect training data for future models, and to fetch pages live so an AI assistant or AI search engine can answer a question and cite you. robots.txt lets you treat them differently — block the first, allow the second — without touching your Google rankings.

Training bots vs AI search bots

User-agentCompanyPurposeTypical choice
GPTBotOpenAIModel trainingBlock
OAI-SearchBotOpenAIChatGPT search resultsAllow
ClaudeBotAnthropicModel trainingBlock
Google-ExtendedGoogleGemini training (not Search)Block
CCBotCommon CrawlOpen dataset used for trainingBlock
BytespiderByteDanceTrainingBlock
Meta-ExternalAgentMetaTrainingBlock
PerplexityBotPerplexityAI search indexAllow

Googlebot and Bingbot are ordinary search crawlers — never block them unless you want to disappear from search results.

A robots.txt that blocks AI training

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Bytespider
Disallow: /

User-agent: Meta-ExternalAgent
Disallow: /

User-agent: *
Allow: /

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

The Robots.txt Generator builds this with one click, adds WordPress or Shopify defaults, and lets you test any URL against the rules before you publish.

Where to put robots.txt

  • WordPress / any Apache or LiteSpeed host: upload robots.txt to the site root (public_html). If an SEO plugin generates a virtual robots.txt, edit it in the plugin instead.
  • Shopify: robots.txt is generated by the theme. Create a robots.txt.liquid template in the code editor and add your rules after Shopify’s default groups.

Always include your sitemap line — create one with the XML Sitemap Generator if your platform doesn’t.

What robots.txt can’t do

robots.txt is a request, not a lock. The major vendors document that their named crawlers respect it, but scrapers that ignore it — or pretend to be a browser — need to be blocked at the server or CDN. On Apache hosting you can deny specific user-agents in .htaccess with the .htaccess Generator, and Cloudflare offers a one-click setting to block AI bots.

Blocking training bots also doesn’t remove content that was collected before you added the rule.

Should you block AI crawlers at all?

It depends on your business. Publishers and course creators often block training bots to protect paid content. Stores and service businesses usually want to be mentioned by AI assistants, so they allow the search bots and only block pure training crawlers — or block nothing. Whatever you choose, review the list once or twice a year: new crawlers appear regularly.

Frequently asked questions

Does blocking GPTBot affect Google rankings?

No. GPTBot is OpenAI’s crawler. Google Search uses Googlebot, and blocking Google-Extended only opts you out of Gemini training — not out of Search.

Do AI crawlers obey robots.txt?

The major vendors say their named crawlers respect robots.txt, but it is a voluntary standard. For bots that ignore it, block them at the server or firewall level.

Should I block AI search bots like OAI-SearchBot?

Usually not. Search and answer bots can cite and link to your pages. Many sites block training crawlers but allow search crawlers.