How to Block AI Crawlers with robots.txt (Without Hurting Your SEO)

Block AI training crawlers by name in robots.txt, keep search crawlers allowed, and know the limits: robots.txt is a request that well-behaved bots follow, not a lock.

By Trends Editorial

Revised First published 4 min read

In brief

Add a User-agent and Disallow rule for each AI crawler you want to block, such as GPTBot, ClaudeBot, Google-Extended and CCBot, and leave Googlebot and Bingbot alone so you stay in search results. A copy-ready robots.txt, the main crawler names and what robots.txt cannot do.

The short answer

Add a block of rules to your site's robots.txt file for each AI crawler you want to stop, and leave search crawlers such as Googlebot and Bingbot allowed. The most common choice is to block crawlers that collect content for AI training, while keeping search crawlers so you still get traffic.

robots.txt is a polite request, not a lock. The major AI companies say they follow it, but bots that ignore it need server-level blocking.

Training crawlers versus search crawlers

AI companies now run several kinds of bots, and blocking them has different effects:

TypeWhat it doesEffect of blocking
Training crawlersCollect pages to train AI modelsYour content is not used in future training by that company
AI search crawlersFetch pages to answer questions and cite sourcesYou may stop appearing, and being linked, in that AI's search answers
User-triggered fetchersFetch a page because a user asked the AI to read itThat AI cannot open your page when a user asks it to
Search engine crawlers (Googlebot, Bingbot)Index your site for searchYou disappear from search results. Do not block these.

The main AI crawler names

These are the user-agent tokens you write in robots.txt. Companies add new ones, so check each company's documentation from time to time.

CompanyTrainingSearch / user requests
OpenAIGPTBotOAI-SearchBot, ChatGPT-User
AnthropicClaudeBotClaude-SearchBot, Claude-User
GoogleGoogle-Extended (a control token, not a separate crawler)Uses Googlebot for Search
AppleApplebot-ExtendedUses Applebot for Siri and Spotlight
Perplexity—PerplexityBot, Perplexity-User
Common CrawlCCBot (its open dataset is widely used for AI training)—
MetaMeta-ExternalAgent—
AmazonAmazonbot—
ByteDanceBytespider—

Step 1: Find or create your robots.txt

robots.txt must sit at the root of your domain, for example https://example.com/robots.txt. Open that address in a browser to see whether you already have one.

  • WordPress: an SEO plugin such as Yoast or Rank Math lets you edit it, or upload a file to the site root.
  • Next.js, Astro and similar frameworks: add robots.txt to the public folder, or generate it with the framework's robots feature.
  • Shopify, Squarespace and Wix: each has its own settings for robots.txt or AI crawlers. Check the platform's help pages.

Step 2: Add the rules

This blocks the main training crawlers while leaving search alone:

# Block AI training crawlers
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: /

User-agent: Bytespider
Disallow: /

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

To also stay out of AI search answers, add OAI-SearchBot, Claude-SearchBot and PerplexityBot to the blocked list.

To block AI crawlers from one section only, for example paid content, use a path instead of /:

User-agent: GPTBot
Disallow: /members/

Step 3: Check it works

  1. Open your robots.txt in a browser and check the rules are there with no typos. User-agent names are not case-sensitive, but paths are.
  2. Check Google Search Console's robots.txt report (under Settings). It shows whether Google can read your file and flags errors. The old standalone robots.txt tester has been retired.
  3. Watch your server logs for a few weeks. Blocked bots that respect robots.txt stop fetching pages other than robots.txt itself.

Common mistakes

  • Blocking Googlebot or Bingbot. That removes you from search results. Block only AI-specific tokens.
  • A typo that blocks everything. User-agent: * followed by Disallow: / blocks every crawler, including search engines.
  • Expecting instant removal. Blocking stops future crawling. It does not remove content already collected or used in training.
  • Relying on Crawl-delay. Many crawlers, including Googlebot, ignore it.
  • Treating robots.txt as security. The file is public and only well-behaved bots obey it. Never use it to hide private pages. Protect those with a login.

When robots.txt is not enough

For bots that ignore robots.txt, block them on the server:

  • CDN and firewall bot controls. Cloudflare and other providers offer one-click AI-bot blocking and bot-management rules.
  • Server rules that return an error to specific user agents. Determined scrapers can fake their user agent, so CDN-level bot detection is more reliable.
  • Rate limiting, which slows any client that requests too many pages too fast.

Key takeaways

  • Block AI crawlers by name: GPTBot, ClaudeBot, Google-Extended, CCBot and others.
  • Never block Googlebot or Bingbot unless you want to leave search.
  • Decide separately whether to block AI search crawlers, which can send you traffic.
  • robots.txt is a request. Use CDN or server-level blocking for bots that ignore it.

Questions readers ask

Will blocking AI crawlers hurt my Google ranking?

No, as long as you block only the AI tokens and leave Googlebot allowed. Google-Extended controls whether your content is used for Gemini and does not affect Google Search rankings. Blocking Googlebot itself would remove you from search, so never do that by accident.

Does blocking Google-Extended remove my site from AI Overviews?

No. Google says AI Overviews are part of Search and use content crawled by Googlebot. Google-Extended controls use in Gemini models and apps. To keep content out of AI Overviews you would have to limit search snippets as well, which also affects normal search results.

Do AI companies actually respect robots.txt?

The major companies, including OpenAI, Anthropic, Google, Apple and Common Crawl, say their crawlers follow robots.txt. Some smaller or less reputable bots ignore it. For those, you need server-level blocking, such as firewall rules or bot-management tools.

Should I block ChatGPT search and other AI search bots too?

Only if you do not want to appear in AI search answers. AI search crawlers such as OAI-SearchBot can send visitors to your site through cited links. Many publishers block training crawlers but allow search crawlers.

Filed under

Found this useful? Pass it on.

Written by

Trends Editorial

A small editorial desk focused on practical, well-structured information that helps readers make confident decisions.

How we research and revise our stories

More from Technology and nearby subjects