robots.txt for AI Crawlers: Keep the Search Bots, Decide on Training, and Verify Who Is Really Crawling
Most robots.txt advice for AI crawlers says "block GPTBot" and stops there. That blocks one of three different jobs, and the job decides what blocking costs you. This post lays out the trade-off, gives you a robots.txt t
Most robots.txt advice for AI crawlers says "block GPTBot" and stops there. That blocks one of three different jobs, and the job decides what blocking costs you. This post lays out the trade-off, gives you a robots.txt that keeps AI search open, a way to test it, a one-liner that shows which AI bots hit your server and what they got back, and a 10-line check that tells a real crawler from something wearing its name.
The bot list itself, checked against every company's own docs on 23 November 2026, is in our AI crawler list. We built it, so treat this as our view, with the sources linked from every row.
The three jobs AI crawlers do
- Search index bots (OAI-SearchBot, Claude-SearchBot, PerplexityBot) build the index an assistant searches. OpenAI says sites that opt out of OAI-SearchBot "will not be shown in ChatGPT search answers."
- User-triggered fetchers (ChatGPT-User, Claude-User, Perplexity-User) open one page because one person asked.
- Training bots (GPTBot, ClaudeBot, CCBot) collect pages for future models. Blocking them does not remove you from live ChatGPT or Claude answers, but future models learn less about you, which shows when an assistant answers from memory without searching.
Google is the odd one out: AI Overviews and AI Mode use the normal Search index, so Googlebot controls them. Google-Extended is a robots.txt token with no crawler behind it.
Here is what the first rows of the list look like, with the share of sites each bot reached in our logs (WordPress sites running the LovedByAI plugin, 23 October to 21 November 2026):
Should you block the training bots? The pros and cons
Most of the advice out there says "block GPTBot". We don't think that's the right default for most sites, so here are both sides.
If you block training bots (GPTBot, ClaudeBot, Google-Extended, CCBot and the rest):
- Your content stays out of future model training.
- Live citations are unaffected: those come from the search bots and fetchers, which keep working.
- But future models learn less about your business. That shows when an assistant answers from memory without searching, which happens a lot for quick "who does X" questions. So you can lose some AI visibility, and it is hard to win back later.
If you allow them:
- Future models know your name, what you do and where.
- Your content may be used to train models, with no payment or credit to you.
For most small businesses we'd allow them, because being known to the model is the point. Publishers and sites whose content is the product often decide the other way. It's a real choice; the search bots are not.
A robots.txt that keeps everything allowed
The default we recommend keeps every crawler in:
# Everyone allowed: search bots, user-triggered fetchers, training bots and search engines.
User-agent: *
Allow: /
If you decide to keep your content out of training, this optional variant blocks only the documented training tokens and leaves every AI search bot and fetcher allowed:
# OPTIONAL. Only if you decide to keep your content out of AI model training.
# Trade-off: future models learn less about your business.
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: meta-externalagent
User-agent: Amazonbot
User-agent: CCBot
User-agent: MistralAI-Training
Disallow: /
# Everyone else, including every AI search bot and fetcher, stays allowed.
User-agent: *
Allow: /
Whatever you choose, never block the search bots (OAI-SearchBot, Claude-SearchBot, PerplexityBot) or the fetchers (ChatGPT-User, Claude-User, Perplexity-User). OpenAI says sites that opt out of OAI-SearchBot "will not be shown in ChatGPT search answers."
Test it before you ship it
Python's standard library has a robots.txt parser, which is enough to catch a group that doesn't do what you meant:
# check_robots.py: which AI bots may fetch "/" under a robots.txt?
import sys, urllib.robotparser
BOTS = ["OAI-SearchBot", "ChatGPT-User", "Claude-SearchBot", "Claude-User",
"PerplexityBot", "Perplexity-User", "GPTBot", "ClaudeBot",
"Google-Extended", "CCBot", "Googlebot", "Bingbot"]
rp = urllib.robotparser.RobotFileParser()
rp.parse(open(sys.argv[1]).read().splitlines())
for bot in BOTS:
print(f"{bot:<17} {'allowed' if rp.can_fetch(bot, '/') else 'BLOCKED'}")
Run against the optional variant, it shows exactly what you'd be giving up and what stays open:
$ python3 check_robots.py robots-no-training.txt
OAI-SearchBot allowed
ChatGPT-User allowed
Claude-SearchBot allowed
Claude-User allowed
PerplexityBot allowed
Perplexity-User allowed
GPTBot BLOCKED
ClaudeBot BLOCKED
Google-Extended BLOCKED
CCBot BLOCKED
Googlebot allowed
Bingbot allowed
On the default file every line says allowed. If a search bot or fetcher ever shows BLOCKED, fix that first.
Python's parser is a sanity check, not the spec. It does not implement every RFC 9309 rule (longest-match precedence, for one), so keep each bot in a single group as above and you avoid the cases where parsers disagree.
Four things to know before you deploy:
- Changes take time. OpenAI, Perplexity and Meta say about 24 hours, DuckDuckGo 72 hours, and Amazon caches robots.txt for up to 30 days.
- The fetchers may not read it at all. By their operators' own words: ChatGPT-User "robots.txt rules may not apply", Perplexity-User "generally ignores robots.txt rules", meta-externalfetcher "may bypass robots.txt". Anthropic says Claude-User honors it.
-
A firewall beats robots.txt. If your WAF, CDN or security plugin refuses a bot, the
Allowline does nothing. - Bot names can be faked. That's the last section.
Are you blocking the search bots without knowing it?
Probably not in robots.txt. In our checks of sites running the LovedByAI plugin (23 September to 22 November 2026), GPTBot was blocked in robots.txt on 4.8% of sites and ClaudeBot on 4.4%, against 0.5% for OAI-SearchBot and 0.4% for Claude-SearchBot. People aim robots.txt at training.
Firewalls don't make that distinction. Claude-SearchBot was refused at the server on 3.0% of sites, almost as often as ClaudeBot at 3.4%.
Our check sends each crawler's name from our own servers, so a firewall that verifies crawlers by IP can refuse us and still let the real one in. Read those firewall numbers as an upper bound.
See which AI bots hit your server, and what they got
This counts requests per AI crawler and HTTP status in a combined-format access log (nginx or Apache defaults):
#!/bin/sh
# ai-bots.sh: requests and status per AI crawler in a combined-format access log.
# Usage: ./ai-bots.sh /var/log/nginx/access.log
BOTS='OAI-SearchBot|ChatGPT-User|GPTBot|Claude-SearchBot|Claude-User|ClaudeBot|PerplexityBot|Perplexity-User|meta-webindexer|meta-externalfetcher|meta-externalagent|Amzn-SearchBot|Amazonbot|DuckAssistBot|MistralAI-User|CCBot|Bytespider'
grep -oE "\" [0-9]{3} .*($BOTS)" "$1" \
| sed -E "s/^\" ([0-9]{3}) .*($BOTS).*/\2 \1/" \
| sort | uniq -c | sort -rn
On a small illustrative log (not real traffic):
$ ./ai-bots.sh access.log
2 OAI-SearchBot 200
1 PerplexityBot 200
1 GPTBot 403
1 Claude-SearchBot 200
1 ChatGPT-User 200
A 403 or 503 next to a search bot or fetcher is the thing to look for: that's a firewall rule costing you citations. The match is case-sensitive on purpose, so ClaudeBot's contact address ([email protected]) inside other user agents doesn't get counted as ClaudeBot.
Verify the crawler is real
A user agent is a claim. OpenAI, Anthropic, Perplexity, Google and others publish their crawler IP ranges as JSON, so checking a request takes ten lines:
# verify_ip.py: is this IP in a crawler's published ranges?
# Usage: python3 verify_ip.py <ip> [list_url]
import ipaddress, json, sys, urllib.request
ip = ipaddress.ip_address(sys.argv[1])
url = sys.argv[2] if len(sys.argv) > 2 else "https://openai.com/searchbot.json"
req = urllib.request.Request(url, headers={"User-Agent": "ip-check/1.0"})
data = json.load(urllib.request.urlopen(req, timeout=10))
nets = [ipaddress.ip_network(p.get("ipv4Prefix") or p.get("ipv6Prefix")) for p in data["prefixes"]]
match = next((n for n in nets if ip in n), None)
print(f"{ip}: {'verified, in ' + str(match) if match else 'NOT in the published list'} ({len(nets)} ranges checked)")
Pipe in every IP that claimed to be OAI-SearchBot:
$ grep 'OAI-SearchBot' access.log | awk '{print $1}' | sort -u | xargs -n1 python3 verify_ip.py
104.210.140.129: verified, in 104.210.140.128/28 (39 ranges checked)
20.171.207.1: NOT in the published list (39 ranges checked)
The same script works with https://claude.com/crawling/bots.json (Anthropic), https://www.perplexity.ai/perplexitybot.json and Google's googlebot.json, which share the prefixes format. Every list we found is linked from its row in the AI crawler list, and the whole table is a CSV if you want to generate your rules from it.
If you run a firewall, this is also the fix for the blocks above: allow the search bots and fetchers by their published ranges, not by name.
Full list, reach and block data, and the method: AI crawler list 2026 on lovedby.ai.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.

