The safest robots.txt for AI crawlers allows the bots behind AI search answers (OAI-SearchBot, Claude-SearchBot, PerplexityBot) and disallows the training bots (GPTBot, ClaudeBot).
A robots.txt for AI crawlers has to treat 3 jobs separately: training, search and user requests. 1 wrong line can remove you from ChatGPT or Perplexity answers.
This file is the technical layer that comes first in AI optimization.
Key rules at a glance
- In your robots.txt for AI crawlers, allow OAI-SearchBot, Claude-SearchBot and PerplexityBot to stay citable in ChatGPT, Claude and Perplexity.
- Disallow GPTBot and ClaudeBot to opt out of training on your future content.
- Repeat your private paths inside every bot group you name, because a named group ignores
User-agent: *. - Test the live file, then check your firewall, because robots.txt cannot open a door that a 403 has already closed.
robots.txt for AI Crawlers: Copy-Paste File to Allow AI Search and Opt Out of Training
Paste this robots.txt for AI crawlers at yourdomain.com/robots.txt. It keeps the 3 AI search bots allowed so they can cite you.
It disallows GPTBot, ClaudeBot, CCBot, Google-Extended and Applebot-Extended. Swap the WordPress admin paths for your own private paths.
# Everyone else: your normal rules
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
# AI search and answer bots: allowed
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Allow: /
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
# AI training bots: opted out
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /
Sitemap: https://yourdomain.com/sitemap.xml
The 3 groups in this file work as follows:
- The first group holds your existing rules for every crawler that has no group of its own.
- The second group names the 3 AI search bots so they stay eligible for citations, and it repeats the private paths on purpose.
- The third group declines training use by 5 crawlers and control tokens.
ChatGPT-User, Claude-User and Perplexity-User are not named, so they follow the first group. That is intentional, because those fetchers run when a person asks about your page.
No private paths? Delete the /wp-admin/ lines.
Where to edit robots.txt by platform:
- WordPress with Rank Math: General Settings, then Edit robots.txt. A physical file in the site root overrides the editor.
- WordPress with Yoast SEO: Tools, then File editor. Security plugins may add their own rules.
- Shopify: the
robots.txt.liquidtheme template. - Wix: SEO Tools, then the robots.txt editor.
- Static site or Next.js: a
robots.txtfile in the public folder.
Menu names vary by version, so confirm the path in your dashboard. Every subdomain needs its own file.
GPTBot vs OAI-SearchBot vs ClaudeBot vs PerplexityBot: What Each AI Crawler Does
Every robots.txt for AI crawlers starts from 1 fact: OpenAI, Anthropic and Perplexity each split crawling into 3 jobs, namely training, search indexing and user-requested fetching.
Perplexity has no training crawler. Blocking 1 bot never blocks its siblings, so set 1 rule per job.
| Job | OpenAI | Anthropic | Perplexity |
|---|---|---|---|
| Model training | GPTBot | ClaudeBot | None (Perplexity says PerplexityBot is not used for training) |
| Search indexing, the source of citations | OAI-SearchBot | Claude-SearchBot | PerplexityBot |
| Fetch when a person asks | ChatGPT-User | Claude-User | Perplexity-User |
| Follows robots.txt? | GPTBot and OAI-SearchBot yes, ChatGPT-User may not | Anthropic says its bots honor it | PerplexityBot yes, Perplexity-User generally ignores it |
Vendor documentation: OpenAI’s bot documentation, Anthropic’s crawler help article and Perplexity’s crawler guide.
OpenAI crawlers: GPTBot, OAI-SearchBot and ChatGPT-User
OpenAI runs 3 main bots, and only 1 of them controls ChatGPT citations:
- GPTBot collects content that may be used for training. Disallowing it signals that your content should stay out of training, and ChatGPT search is unaffected.
- OAI-SearchBot powers ChatGPT search. Sites that opt out will not appear in ChatGPT search answers, though the URL can still show as a plain link.
- ChatGPT-User visits a page when a person asks about it. OpenAI says robots.txt rules may not apply to it.
OAI-AdsBot is a 4th bot, and it only checks landing pages submitted as ChatGPT ads.
OpenAI says a search-side change can take about 24 hours to show. For the Bing side of ChatGPT visibility, read why Bing indexing matters for ChatGPT citations.
Anthropic crawlers: ClaudeBot, Claude-SearchBot and Claude-User
- ClaudeBot is the training crawler. Blocking it alone leaves Claude search untouched.
- Claude-SearchBot indexes pages for Claude search. Anthropic says blocking it may reduce your visibility and accuracy in Claude’s search results.
- Claude-User fetches a page on a person’s request.
Older blocklists also carry anthropic-ai and Claude-Web. Anthropic’s current page does not list them.
Adding them is harmless but unconfirmed.
PerplexityBot and Perplexity-User: the Perplexity crawlers
- PerplexityBot surfaces and links sites in Perplexity search results. Perplexity says it is not used for training and that the bot honors robots.txt.
- Perplexity-User fetches a page after a person’s action. Perplexity says it generally ignores robots.txt for that reason.
Perplexity recommends allowing PerplexityBot if you want to appear in results. A Disallow line will not reliably stop Perplexity-User.
Google-Extended and AI Overviews: a control token, not a crawler
Google-Extended has no user-agent string of its own. Googlebot still does the crawling, so the token never appears in your server logs.
What each Google rule changes:
- Disallow for Google-Extended: opts your content out of Gemini training and grounding. Search and AI Overviews are unchanged.
- Disallow for Googlebot: removes you from Search, and AI Overviews and AI Mode go with it.
nosnippeton a page: limits the snippet under the same preview controls that AI Overviews follow.
See GEO vs AEO vs SEO for how these systems differ.
Should You Allow or Block AI Crawlers? A Decision Table by Goal
For most small business sites, a robots.txt for AI crawlers should allow the search bots and decide on training separately.
Cloudflare reported in September 2026 that fewer than 1% of its sites block Search bots, while 17% enable some mechanism to block training.
Most site owners split the 2 decisions the same way.
| Your goal | Search bots | Training bots | Usually fits |
|---|---|---|---|
| Be cited everywhere, no objection to training | Allow | Allow | Local businesses, consultants, SaaS marketing sites |
| Be cited, but opt out of training | Allow | Disallow | Bloggers, publishers, original-research sites |
| Stay out of AI answers and training | Disallow | Disallow | Licensed or paywalled content |
| Different rules by section | Allow some paths | Disallow some paths | Stores, member areas |
Blocking search bots in your robots.txt for AI crawlers costs you visibility:
- OpenAI: your pages stop appearing in ChatGPT search answers.
- Anthropic: your visibility and accuracy in Claude search may drop.
- Perplexity: your pages are less likely to be linked in its results.
- Buyers: a person asking an AI tool for a supplier in your city sees your competitors first. Our guide on how local businesses show up in ChatGPT and AI search covers that shortlist.
Access makes a page eligible. It does not earn a citation. What earns one is covered in what gets content cited by AI.
After access is fixed, 2 page-level factors do most of the work:
- The first 300 words of your page should state the answer.
- Entity clarity tells AI systems exactly who and what the page is about.
Blocking both bot types is a legitimate choice for licensed content. Make it knowingly, not by pasting a blocklist.
No setting guarantees a citation, which is why a guaranteed AI citation is a red flag.
robots.txt for AI Crawlers by Site Type: Examples to Allow or Block Each Bot
Pick the robots.txt for AI crawlers that matches how your site earns money. Stores close carts, publishers close members areas, SaaS sites stay open, and a full opt-out names 11 bots.
Every file below was run through the same parser before publishing.
robots.txt for AI crawlers on an online store (WooCommerce or Shopify)
Stores need cart, checkout and parameter URLs closed to every bot while product pages stay open.
Putting the wildcard and the search bots in 1 group keeps those rules in 1 place.
User-agent: *
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Disallow: /cart/
Disallow: /checkout/
Disallow: /my-account/
Disallow: /*?add-to-cart=
Disallow: /*?orderby=
User-agent: GPTBot
User-agent: ClaudeBot
Disallow: /
Sitemap: https://yourdomain.com/sitemap.xml
Parser result: OAI-SearchBot fetched product pages but not /checkout/. GPTBot was blocked from everything, and Bingbot stayed blocked on /cart/ and allowed on /products/.
Publisher or membership site: block GPTBot, keep articles citable
This robots.txt for AI crawlers keeps articles open to AI search and the members area closed to everyone. 4 training bots are opted out.
User-agent: *
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Disallow: /members/
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
Disallow: /
Sitemap: https://yourdomain.com/sitemap.xml
Parser result: OAI-SearchBot and Googlebot could read /blog/, both were blocked on /members/, and GPTBot and ClaudeBot were blocked everywhere.
Business site, SaaS or agency: allow all AI crawlers
If every AI bot should read everything, your robots.txt for AI crawlers needs almost nothing.
User-agent: *
Disallow: /admin/
Sitemap: https://yourdomain.com/sitemap.xml
No bot names are needed, because nothing is blocked. robots.txt is allow-by-default.
An Allow: / line for each AI crawler changes nothing here, even when an automated audit tells you to add them.
Full AI opt-out: block GPTBot, ClaudeBot and PerplexityBot together
This robots.txt for AI crawlers asks every compliant bot to stay away and takes you out of AI search answers.
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: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /
Parser result: all 11 names were blocked, while Googlebot and Bingbot stayed allowed.
Bots that ignore the file, such as user-triggered fetchers, need a firewall rule instead.
The Wildcard Trap: Why GPTBot Ignores Your User-agent: * Rules
A crawler obeys only the most specific group that matches its name. Google’s documentation confirms that specific groups and the * group are never combined.
Once GPTBot has its own group, every Disallow under * stops applying to it. Repeat each private path inside every named group.
This is the most common mistake in a robots.txt for AI crawlers: a named bot reaches pages you thought were private.
We reproduced it with Protego 0.7.0, a parser built to the RFC 9309 robots exclusion standard. It is also why the starter file repeats the admin paths inside the search-bot group.
Parsing rules that commonly cause mistakes:
- Bot names are case-insensitive, so
gptbotandGPTBotmatch the same group. - Paths are case-sensitive, so
/Private/is not/private/. - The longest matching path wins, and the least restrictive rule wins a tie. File order does not decide.
- Google ignores everything past 500 KiB.
- A 4xx response means no robots.txt exists, so no limits apply. A 5xx or 429 pauses Google crawling.
- Each host needs its own file, so a blog subdomain does not inherit the root rules.
Google also caches the file for up to 24 hours, so a fresh edit is not instant.
Beyond robots.txt: Cloudflare, Firewalls and IP Checks for AI Crawlers
A robots.txt for AI crawlers is a request, not a lock. 2 other layers decide whether an AI crawler gets a page: your CDN or firewall, and your server.
A perfect file does nothing if a firewall returns a 403 before the bot reads it.
The 3 layers, in the order a crawler meets them:
- Policy (robots.txt): states what compliant bots are asked to crawl. Typical failures are the wildcard trap and copied blocklists.
- Edge (CDN, WAF, host firewall): decides whether a request gets a page at all. Typical failures are a 403, a 429 or a challenge page sent to an allowed bot.
- Origin (server and rendering): decides what the bot sees once it gets in. Typical failures are an empty JavaScript shell or a 5xx error.
Layer 3 deserves its own read: JavaScript-heavy websites are invisible to AI crawlers, even when every rule above is correct.
During every Best SEO Service Agency audit, we check layers 2 and 3 before touching content.
Cloudflare AI crawl controls after September 15, 2026
Cloudflare replaced its old “Block AI Bots” switch with 3 controls: Search, Training and Agent. The trap is the Training control.
- Block for Training also stops Googlebot, Bingbot and Applebot, so you drop out of regular search too.
- Disallow AI Training writes a no-training preference into robots.txt and keeps those mixed-use crawlers allowed for search.
- Bingbot stays an exception until Microsoft supports a robots.txt no-training signal, which Cloudflare expects in early 2027. Cloudflare suggests the
NOARCHIVEmeta tag as an interim opt-out for Bing.
If Cloudflare manages your robots.txt, it can prepend its own rules to yours. Read the live file, not the one in your CMS.
Cloudflare’s managed robots.txt documentation explains how the 2 files combine.
Hosts and security plugins matter too:
- OpenAI and Perplexity both ask site owners to allow their published IP ranges as well as the robots.txt rule.
- Perplexity adds that firewall rules should match the user agent and the IP together.
Verify GPTBot, ClaudeBot and PerplexityBot by IP address
Anyone can type “ClaudeBot” into a user-agent header, so a name in your logs proves nothing. Check the source IP against the vendor’s published list.
- OAI-SearchBot:
openai.com/searchbot.json - GPTBot:
openai.com/gptbot.json - ChatGPT-User:
openai.com/chatgpt-user.json - PerplexityBot:
perplexity.ai/perplexitybot.json - Perplexity-User:
perplexity.ai/perplexity-user.json - Anthropic bots:
claude.com/crawling/bots.json
Use these lists to verify and to allow, not to block. Anthropic warns that IP blocking may not work correctly or persistently.
Keep the ClaudeBot opt-out in robots.txt.
Training opt-out signals coming in 2026 and 2027
Training opt-outs are moving beyond bot names:
- Anthropic describes a “no AI training” preference signal starting October 30, 2026, and says rules naming ClaudeBot take priority over it.
- Google plans to support a shared machine-readable training preference in early 2027.
- Cloudflare’s Content Signals Policy already supports lines such as
Content-Signal: search=yes, ai-train=no.
Keep your named groups now and review the file once a quarter. The new signals will sit on top of bot names, not replace them.
How to Test robots.txt for AI Crawlers: curl, a Python Parser and Server Logs
Test your robots.txt for AI crawlers in 4 layers: the live file, a parser grid, status codes for bot user agents, and server logs.
Wait 24 hours before judging, because OpenAI and Perplexity both say changes can take about that long.
robots.txt for AI crawlers tester: 5 steps for GPTBot, ClaudeBot and PerplexityBot
- Open
yoursite.com/robots.txtin a browser and confirm an HTTP 200 status. Repeat for every subdomain, because each host needs its own file. - Paste the file into any robots.txt tester that follows RFC 9309. Check GPTBot, OAI-SearchBot, ClaudeBot, Claude-SearchBot and PerplexityBot against your homepage, one blog post and one private path, then compare the results with your policy. Our team at Best SEO Service Agency uses this check as a first pass.
- Load the same page once with a normal browser user agent and once with each bot’s user agent, using any tool that lets you switch it. Compare status codes and page sizes. A 403, a 429 or a much smaller page for a bot points to a firewall rule.
- Read your access log for real bot hits, then check those IPs against each vendor’s published IP list.
- Wait 24 hours and test again before deciding anything is broken, because crawlers can cache robots.txt for up to a day.
Script-based analytics will not show these hits, because AI crawlers do not run tracking scripts. Use server logs or your CDN’s AI crawler report.
After the fix holds, measure what changed:
- Start with how to measure AI visibility.
- Remember that the same AI prompt gives different answers, so 1 test prompt proves little.
- Take an AI citation baseline for a fair before-and-after.
- For reporting beyond raw counts, see what real GEO reporting should look like.
robots.txt blocking AI crawlers: symptoms, causes and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| ChatGPT never cites you, yet OAI-SearchBot is allowed | A firewall challenge, a 403, a JavaScript-only page, or a page missing from Bing | Run step 3, allow OpenAI’s published IPs, check the raw HTML |
| You blocked GPTBot, but ChatGPT still fetched a page | ChatGPT-User is user-initiated and may skip robots.txt | Use a firewall rule only if you must stop it |
A * rule is ignored by 1 AI bot |
That bot has its own group | Repeat the rule inside the named group |
| You blocked Google-Extended and still appear in AI Overviews | The token governs Gemini training, not Search features | Control AI Overviews with Googlebot rules and snippet controls |
| Your edit does not show on the live site | A CDN prepends rules, a plugin serves a virtual file, or a cache is stale | Fetch the live URL, purge caches, wait up to 24 hours |
| robots.txt returns 403 or 5xx | Server or firewall error | Fix it fast, because Google pauses crawling on 5xx and 429 |
| A blog subdomain ignores your rules | Each host needs its own file | Add a file at the root of every subdomain |
robots.txt for AI crawlers: pre-publish checklist
Before you edit
Decide search-bot and training-bot policy separately, using the decision table.
Save a copy of the current live robots.txt so you can roll back.
List every host that needs a file: www, blog, shop and docs.
Check whether Cloudflare, your host or a plugin manages robots.txt for you.
In the file
Name OAI-SearchBot, Claude-SearchBot and PerplexityBot only when they need rules different from *.
Disallow GPTBot and ClaudeBot only when you want to opt out of training.
Repeat every private path inside each named group.
Never paste a blocklist that includes search bots unless you want them blocked.
Add a Sitemap: line with the full URL, and keep the file under 500 KiB.
After you publish
Fetch the live file and confirm HTTP 200.
Run the parser grid from step 2 against your policy.
Run the curl check from step 3 with browser and bot user agents.
Allow the vendors’ published IP ranges in any firewall.
Check server logs after 24 hours and verify IPs, not only names.
Add a quarterly reminder to re-read the vendor pages.
Best SEO Service Agency uses this robots.txt for AI crawlers checklist as the first pass of every audit.
2 related resources:
- llms.txt does not replace robots.txt, because the 2 files do separate jobs.
- Once crawlers reach your pages, writing standalone answers that AI systems can extract decides whether they use them.
FAQs: robots.txt for AI Crawlers
1. Should I block GPTBot?
Block GPTBot only if you object to training use of your content; it does not remove you from ChatGPT search, which OAI-SearchBot controls separately.
2. Do I need to list every AI bot if I already allow everything?
No, because robots.txt is allow-by-default; name a bot only when it needs different rules from the wildcard group.
3. Does robots.txt for AI crawlers stop them from using my content?
Only compliant bots, and only for future crawling; ChatGPT-User and Perplexity-User are user-initiated and may skip it, so use your CDN or firewall to enforce.
4. Will blocking AI crawlers hurt my Google rankings?
Blocking GPTBot, ClaudeBot or Google-Extended does not affect Google Search, but blocking Googlebot does, including AI Overviews and AI Mode.
5. How long until a robots.txt change takes effect?
OpenAI and Perplexity say about 24 hours and Google caches the file for up to 24 hours; Anthropic gives no figure, so retest after a day.
Conclusion: A Short, Tested robots.txt for AI Crawlers Beats a Long Blocklist
A good robots.txt for AI crawlers is short, deliberate and verified.
Decide search and training separately, name only the bots that need their own rules, and repeat private paths in every named group. Then test the edge as well as the file.
Date the next review, because bot names, Cloudflare defaults and training signals all shifted in 2026.
For the markup behind the FAQs above, see FAQPage vs QAPage schema. For the wider picture, read what GEO means in practice and how AI search engines rank sources.
Talk to Best SEO Service Agency about your AI crawler setup
Not sure your robots.txt for AI crawlers works for GPTBot, ClaudeBot and PerplexityBot? Our team at Best SEO Service Agency checks 3 things:
- Your live robots.txt, parsed against the policy you choose.
- Your CDN and firewall rules for bot user agents and IP ranges.
- Your server logs, to show which verified bots reach your pages and which get turned away.
Book a Free Strategy Call and we will walk through the results.
Related reading before choosing a provider: