To block AI crawlers, add a robots.txt group for each bot you want out. Block training crawlers such as GPTBot and Google-Extended, and keep search crawlers such as OAI-SearchBot and PerplexityBot allowed. Blocking everything also removes you from AI answers, so decide by purpose, not by the label "AI".
Why "block AI crawlers" is the wrong question
Most advice treats every AI bot as one thing. It is not. The same company often runs several crawlers with different jobs, and the robots.txt rule you write for one does not touch the others. OpenAI says so directly: each of its settings is independent of the others.
Think of AI bots in three groups:
- Training crawlers collect content that may be used to train models. Blocking them keeps your pages out of future training data.
- Search crawlers build the index that AI search products draw their cited answers from. Blocking them removes you from those citations.
- User-triggered fetchers visit a page because a person asked a question about it. Their rules are different, as the table below shows.
The decision for most small sites is simple. You can opt out of training and stay visible in AI answers at the same time. That takes about six lines of text.
Which bot does what?
This table covers the crawlers the vendors document themselves. Check each vendor page before you rely on a name, because user agents change.
| Crawler | Operator | Purpose | Block it to... |
|---|---|---|---|
| GPTBot | OpenAI | Content that may train generative models | Opt out of OpenAI training |
| OAI-SearchBot | OpenAI | Surfacing sites in ChatGPT search | Leave ChatGPT search answers |
| ChatGPT-User | OpenAI | User-initiated visits | Not reliable, robots.txt may not apply |
| Google-Extended | Gemini training and grounding control | Opt out of Gemini use, Search unaffected | |
| PerplexityBot | Perplexity | Surfacing and linking sites in Perplexity search | Leave Perplexity results |
| Perplexity-User | Perplexity | User-initiated visits | Generally ignores robots.txt |
The sources behind the table: OpenAI's bots page, Google's common crawlers page and Perplexity's bot guide. For one-bot deep dives, see our posts on GPTBot, OAI-SearchBot, PerplexityBot and Google-Extended.
What to put in robots.txt
Here is a file that opts out of training but stays open to AI search. Place it at the root of your domain, at /robots.txt.
- Block OpenAI training. Add
User-agent: GPTBotfollowed byDisallow: /. OpenAI states that disallowing GPTBot indicates a site's content should not be used in training generative AI foundation models. - Block Gemini training use. Add
User-agent: Google-Extendedfollowed byDisallow: /. Google says this token does not affect inclusion in Google Search and is not a ranking signal. - Keep search bots in. Add
User-agent: OAI-SearchBotandUser-agent: PerplexityBot, each withAllow: /. Perplexity recommends allowing PerplexityBot, and OpenAI recommends allowing OAI-SearchBot so your site appears in search results. - Leave Googlebot alone. Do not add a rule for it. Googlebot is what keeps you in normal Google results.
If you want the opposite, to be cited more, read how to allow ChatGPT and Perplexity in robots.txt.
What blocking does not do
A robots.txt file is a request, not a lock. Well-behaved crawlers honor it. It has three limits worth knowing.
It does not cover user-triggered fetches
OpenAI notes that because ChatGPT-User actions are initiated by a user, robots.txt rules may not apply. Perplexity says its user fetcher generally ignores robots.txt rules because a user requested the fetch. If a person pastes your URL into a chat, the assistant can still read it.
It does not remove what was already collected
A new rule applies from the next crawl. It is not a takedown of earlier copies. Both OpenAI and Perplexity say changes can take up to about 24 hours to be picked up.
It is not security
Anyone can ignore a robots.txt file, and the file itself is public. For pages that must stay private, use a login or server-level access rules. If you mean to keep a page out of Google's index rather than out of AI crawlers, that is a different tool, covered in robots.txt vs noindex.
How to check that it worked
After you publish the file, do three checks.
- Open
yourdomain.com/robots.txtin a browser and confirm the groups appear exactly as written, with no stray characters. - Look at your server logs a day later. A training bot that still fetches pages after a Disallow rule is ignoring the rule, and a server-level block is the next step.
- Watch your AI referrals and citations. If they drop after the change, you may have blocked a search crawler by mistake. Our guide to AI crawler monitoring shows what to look for.
Should you block at all?
It depends on what the content is worth to you and where your readers come from.
- You sell something and want to be recommended: allow the search crawlers. Being named in an AI answer is the new top-of-page slot. Blocking training crawlers is optional and mostly a policy choice.
- Your content is the product, such as paid research: block training crawlers, and consider limiting search crawlers to a free preview section.
- You are unsure: start with the six-line file above. It is easy to reverse.
The wider picture of what helps AI systems pick you is in how to optimize for AI search.
Frequently Asked Questions
Does blocking AI crawlers hurt my Google rankings?
Not if you block training tokens only. Google states that Google-Extended does not affect inclusion in Search or act as a ranking signal. Blocking Googlebot itself would hurt, so never do that.
Will blocking GPTBot remove me from ChatGPT answers?
No. GPTBot is the training crawler. ChatGPT search results come from OAI-SearchBot, which you control separately. Our post on whether blocking GPTBot hurts SEO covers it in full.
Can I block just one page from AI bots?
Yes. Use a path in the Disallow line, such as Disallow: /pricing-research/, under the bot's user agent group.
How long until a robots.txt change takes effect?
OpenAI says search-related changes can take about 24 hours to apply, and Perplexity gives the same figure. Allow a day before you judge the result.
Do all AI crawlers obey robots.txt?
No. The major vendors document that their main crawlers do, but user-triggered fetchers and unknown scrapers may not. For those, block at the server or firewall.