Decide What You're Blocking
Most AI companies now run separate bots for separate jobs. Training crawlers collect pages for future models. Search crawlers build the index an AI search product answers from. User fetchers open a page because someone asked an assistant about it.
If you want to keep showing up in search, including AI search, the bots to block are the training ones.
Blocking the search crawlers keeps you out of those companies' answers, and blocking the user fetchers means an assistant can't read your page even when a person pastes the link into a chat.
I won't repeat the full list of user agents here. My guide to robots.txt for AI crawlers has every token worth knowing, grouped by company and by job. This guide is about doing the blocking safely and making it stick.
Googlebot vs Google-Extended
Never block Googlebot to keep your site out of AI. Googlebot is the crawler behind Google Search, and blocking it removes you from search results entirely.
Google's AI controls work through a separate token called Google-Extended. It isn't a crawler, so you'll never see it in your logs.
Googlebot and Google's other crawlers do all the fetching, and Google-Extended tells Google whether what they fetched may be used to train future Gemini models and to ground answers in Google's AI products outside Search.
Google says disallowing it doesn't affect your inclusion in Search or your rankings.
It also doesn't keep you out of AI Overviews or AI Mode, because those are part of Google Search and use the regular Googlebot crawl. No robots.txt rule takes a page out of AI Overviews while leaving it in search.
Since August 2026 there's a setting for it in Search Console instead, under Settings and then Search generative AI.
Choosing Exclude takes your pages out of AI Overviews and AI Mode within a few days, and Google's AI controls page says it isn't used for ranking the rest of Search.
The older route is the nosnippet meta tag and its relatives, which also strip your snippet from ordinary results.
Apple
Apple works the same way. Apple's Applebot page says Applebot crawls for Spotlight, Siri, and Safari, and Applebot-Extended doesn't crawl at all.
It only controls whether that crawl may train Apple's models, so block the -Extended token and leave the crawler alone.
Apple also uses Applebot's crawl to ground answers in Siri, and the opt-out for that is nosnippet, the same as Google's older route.
If your robots.txt doesn't name Applebot but does name Googlebot, Applebot follows the Googlebot rules.
Bing
Bing has no separate AI crawler, so Bingbot is in the same position as Googlebot. Blocking it takes you out of Bing and everything built on Bing's index.
Bing's AI controls are page tags instead, and they're changing.
Today noarchive keeps a page out of Copilot answers and training. nocache limits what Copilot shows, and what Microsoft trains on, to the URL, title, and snippet. That's how Bing explained them when it introduced them for what was then Bing Chat.
On October 30, 2026, Microsoft announced replacements that take over on February 1, 2027. Training moves to the shared robots.txt token below, and AI answers get a page-level tag:
<meta name="Bingbot" content="ai-grounding:disallow">
None of these affect whether you show up in Bing's ordinary results.
The robots.txt Rules
Here's the training-only setup. Every training crawler and control token goes in one group, and everything else falls through to the * group:
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: meta-externalagent
User-agent: CCBot
User-agent: Bytespider
Disallow: /
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xml
There are 2 things that catch people out.
The first is the * group. A bot that finds a group with its own name ignores the * group completely, so a rule you put under * (say, Disallow: /admin/) doesn't apply to GPTBot once GPTBot has a group of its own.
Copy those shared rules into the named group if they matter.
The other is Amazon. Amazon's crawler docs say Amazonbot improves its products and may be used to train its AI models. Its search features like Alexa use a separate bot, Amzn-SearchBot, that doesn't crawl for training.
If you want the training side gone, add Amazonbot to the group above and leave Amzn-SearchBot alone.
Meta has a similar split. Meta's crawler page lists meta-externalagent for training, and Meta-WebIndexer for the search that lets Meta AI cite and link to you.
Leave facebookexternalhit alone too, since it builds the link previews on Facebook, Instagram, and Messenger.
A shared training token is arriving
On October 30, 2026, Anthropic, OpenAI, Google, and Microsoft all said they'd honor a shared robots.txt token for AI training.
It's defined in an individual IETF draft that builds on the AI Preferences working group's vocabulary, and it's an ordinary group whose user agent is a policy token:
User-agent: __usage_ai-training
Disallow: /
Anthropic says it has already begun recognizing it, and that a group naming ClaudeBot still takes priority. OpenAI aims to start "in the coming months", Microsoft on February 1, 2027, and Google in early 2027.
Google's announcement says it plans to read the group as a disallow for Google-Extended when a site doesn't name Google-Extended itself.
Adding it now is harmless, since crawlers that don't know the name ignore it. Keep the per-company groups above too, because those are what most of them honor today.
Content-Signal
Cloudflare's Content-Signal line goes in robots.txt too, and it says how pages may be used once they're fetched, as opposed to which bots may fetch them:
User-agent: *
Content-Signal: search=yes, ai-input=yes, ai-train=no
Allow: /
Each value is a yes or no. ai-train=no asks not to be used for training, while search and ai-input cover search results and live AI answers.
It's a stated preference, and no major AI company has said publicly that it reads it, so treat it as an extra on top of the user-agent rules and never as a replacement.
This site serves one, with all 3 set to yes, and my guide to Content Signals goes through each value.
Blocking Bots That Ignore robots.txt
robots.txt only works on bots that choose to follow it. For the rest you need the server or the CDN to refuse the request.
The cleanest way in nginx is a map that turns the user agent into a yes or no, and one check in the server block:
# In the http context (a file in sites-enabled is included there).
map $http_user_agent $blocked_ai_bot {
default 0;
~*Bytespider 1;
~*CCBot 1;
}
server {
# ...
if ($blocked_ai_bot) {
return 403;
}
}
~* makes each pattern a case-insensitive regex, and adding a bot is one more line.
If your server hosts several sites, give the variable a prefix. This site's nginx.conf uses a map for its cache lifetimes and calls it $joncphillips_expires for that reason, since every map is shared by every site on the box.
Test it with curl before you trust it:
curl -sI -A "Mozilla/5.0 (compatible; Bytespider)" https://example.com/ | head -1
curl -sI https://example.com/ | head -1
The first should say 403 and the second 200.
What a user-agent block can't stop
A user-agent rule only stops bots that tell you who they are. A scraper that sends a browser's user agent sails past it.
On Contrastly, the photography site I wrote about in the robots.txt guide, 213 of the 216 visits claiming to be CCBot came from somewhere else entirely. Blocking the name CCBot stops those, but the same scraper can switch to any name you haven't listed.
For floods, rate limiting helps more than names do. This site rate-limits its URL tools in nginx, and the same pattern works for a whole site:
limit_req_zone $binary_remote_addr zone=joncphillips_tools:1m rate=10r/m;
location = /tools/inspect/ {
limit_req zone=joncphillips_tools burst=5 nodelay;
limit_req_status 429;
# ...
}
That allows 10 requests a minute from one address, with a burst of 5, and answers 429 past that.
For a whole site you'd set the rate much higher, since a person reading a few pages loads a lot of files.
If you're on Cloudflare, its AI crawler blocking is the easier route, with one catch.
On the free plan, Cloudflare's AI Crawl Control docs say it spots AI crawlers by their user agent, the same as the nginx rule above.
The more thorough detection comes with its Bot Management, which those docs list for Enterprise plans.
It verifies known bots by checking that the address really belongs to the company, so an impostor borrowing a real bot's name won't count as that bot. Other CDNs and bot management services have something similar.
Checking a Bot Is Who It Says It Is
Before you block or allow a bot by IP, confirm the address really belongs to the company. Most of them publish their ranges:
| Bot | How to verify |
|---|---|
| GPTBot, OAI-SearchBot, ChatGPT-User | A list per bot at openai.com/gptbot.json, searchbot.json, and chatgpt-user.json (OpenAI's bot docs) |
| ClaudeBot, Claude-SearchBot, Claude-User | One list for Anthropic's crawlers at claude.com/crawling/bots.json (Anthropic's crawler page) |
| CCBot | Reverse DNS ending in crawl.commoncrawl.org, or the list at index.commoncrawl.org/ccbot.json (Common Crawl) |
| Googlebot | Reverse DNS should end in googlebot.com, google.com, or googleusercontent.com, and the name should resolve back to the same IP (Google's verification guide, which also links its IP lists) |
Anthropic adds a warning worth knowing. Blocking its bots by IP may not keep working, and robots.txt is the opt-out it supports.
Use the lists to check who's visiting, and use robots.txt to say no.
This lists OpenAI's current GPTBot ranges, which you can compare against the addresses in your logs:
curl -s https://openai.com/gptbot.json | jq -r '.prefixes[] | .ipv4Prefix // .ipv6Prefix'
The same command works on the Anthropic, Google, and Common Crawl lists, which use the same shape. Some of them mix in IPv6 ranges, which is why it asks for either.
For Googlebot, do the lookup both ways:
host 66.249.66.1
host crawl-66-249-66-1.googlebot.com
If the first lookup doesn't land on a Google hostname, or the second doesn't come back to the same IP, it isn't Googlebot, whatever the user agent says.
Checking Your Logs
Your access log is where you find out what's actually visiting.
With nginx's default log format, the user agent is the sixth field when you split on quotes, so this counts visits by AI user agent:
grep -Ei "gptbot|claudebot|ccbot|bytespider|perplexitybot|meta-externalagent|amazonbot" \
/var/log/nginx/access.log \
| awk -F'"' '{print $6}' | sort | uniq -c | sort -rn
And this shows which addresses one bot is coming from, so you can check them against the published lists:
grep -i "gptbot" /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head
Look at the status codes too. After you deploy a block, blocked bots should show 403, and the ones that respect robots.txt should taper off within a week or two as they pick up the new file.
Anything still arriving under a name you disallowed, from addresses that check out, is worth reporting to the company.
robots.txt asks a bot to stay away, and a server block makes it. Your logs tell you which of the two each bot needed.
Check Your Work
After any change, test the rules you meant to write against the bots you care about.
The robots.txt Checker loads your live file and tests any path against any user agent, so you can confirm GPTBot is blocked and Googlebot isn't in one go. Always test Googlebot last, because that's the mistake that costs you traffic.
The AI Agent Readiness Check gives the wider view. It flags it when a site blocks search or user crawlers along with the training ones, which is rarely what anyone intended.
If you're weighing whether AI search traffic is worth keeping at all, I wrote about how much it has already changed things in Nobody Clicks Anymore.