Skip to main content

How to Block AI Crawlers with robots.txt

Protect your website from AI crawlers: Complete guide to blocking ChatGPT, Claude & Co. with robots.txt. Simply explained with examples.

FHFinn Hillebrandt
AI Application
How to Block AI Crawlers with robots.txt
Links marked with * are affiliate links. If a purchase is made through such links, we receive a commission.

As an online entrepreneur or blogger, you're facing a new challenge:

Web crawlers from OpenAI, Anthropic, or Google are searching the web and collecting training data for LLMs and other AI models.

Your valuable blog posts that you created with great effort could be used without your knowledge or consent to generate AI-generated texts in ChatGPT & Co.

This can not only violate your copyrights but also jeopardize your competitive position. Somewhat unsettling, isn't it?

Perhaps you're already asking yourself: How can I protect my work? How do I prevent my content from being used for AI training without my consent?

No problem!

In this article, I'll show you simply and step by step how to configure your robots.txt to protect your content.

TL;DRKey Takeaways
  • Create or edit your robots.txt to block specific AI crawlers like GPTBot, ClaudeBot, Claude-User, Claude-SearchBot, Google-Extended, and Applebot-Extended
  • Use selective blocking to protect only certain areas while others stay accessible. Blocking OAI-SearchBot means, according to OpenAI, that your site won't appear in ChatGPT search answers
  • Check in the robots.txt report in Google Search Console that Google can fetch the file. Pair robots.txt with a WAF (e.g., Cloudflare), because user-triggered fetchers like Perplexity-User or ChatGPT-User don't always follow it, according to their providers

1. Preparation

Before we get started protecting your website from curious AI crawlers, you need to make a few preparations. Don't worry, it's easier than you might think!

Access to the web server

First, you need access to your web server. This sounds technical but is often just a login to your hosting account.

If you're using WordPress, you can access your files directly via FTP or the File Manager Plugin.

Backup of existing robots.txt

Safety first! If you already have a robots.txt file, make sure to create a copy. This way you can always revert to the old version in case of emergency:

  • Find the robots.txt file in your website's root directory
  • Download it to your computer or copy the content into a text document
  • Store this backup in a safe place

2. Creating/Editing robots.txt

You don't need to be a programming genius to create or edit your robots.txt file.

Only a few steps are required:

2.1 Opening or Creating the File

First, you need to check if a robots.txt already exists on your website. There's a simple trick for this:

  1. Open your browser
  2. Enter your domain followed by "/robots.txt" (e.g., www.yourwebsite.com/robots.txt)
  3. Do you see text? Great, the file already exists. If not, we'll create a new one.

If you need to create a new file:

  • Open a simple text editor (Notepad, TextEdit, etc.)
  • Create a new, empty document
  • Save it as "robots.txt" (Note: make sure your editor doesn't add a second extension such as "robots.txt.txt")

2.2 Setting Up the Basic Structure

The robots.txt follows a specific syntax (structure). Here are the basics:

text
User-agent: [Name of the crawler]
Disallow: [Path to be blocked]

For starters, you could write something like this:

text
User-agent: *
Disallow:

This means: All crawlers (*) may crawl everything (empty "Disallow"). This is our starting point from which we'll further customize the file.

3. Blocking Specific AI Crawlers

To block common AI crawlers, you need to add the following blocks to your robots.txt:

OpenAI (ChatGPT)

OpenAI documents four user agents with different jobs. GPTBot collects content that may be used to train OpenAI's models. OAI-SearchBot decides whether your pages appear in ChatGPT search answers. ChatGPT-User visits a page when a person asks about it in ChatGPT. OAI-AdsBot only visits pages submitted as ads on ChatGPT.

Check the consequences before you block everything. Without OAI-SearchBot, OpenAI says your site won't appear in ChatGPT search answers. And for ChatGPT-User, OpenAI says robots.txt rules may not apply because a person triggers the fetch. If you want to exclude all three content bots, the block looks like this:

text
User-agent: OAI-SearchBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: GPTBot
Disallow: /

Anthropic (Claude)

Anthropic lists three bots on its crawler help page. ClaudeBot collects content that may be used for model training. Claude-User fetches pages when users ask Claude a question. Claude-SearchBot crawls the web for search results in Claude.

The older strings anthropic-ai and Claude-Web no longer appear on that page, but many blocklists still include them. The two extra entries don't hurt:

text
User-agent: ClaudeBot
Disallow: /

User-agent: Claude-User
Disallow: /

User-agent: Claude-SearchBot
Disallow: /

User-agent: anthropic-ai
Disallow: /

User-agent: Claude-Web
Disallow: /

Google (Gemini)

Google-Extended is not a separate crawler but a control token. According to Google, it determines whether crawled content may be used to train future Gemini models and for grounding in certain products. It has no effect on inclusion or ranking in Google Search.

text
User-agent: Google-Extended
Disallow: /

Common Crawl

text
User-agent: CCBot
Disallow: /

Perplexity

Perplexity ships two bots: PerplexityBot for indexing and Perplexity-User for user-triggered fetches. Note that, according to Perplexity, Perplexity-User generally ignores robots.txt because a user requested the fetch. An additional WAF or firewall rule is often a good idea here.

text
User-agent: PerplexityBot
Disallow: /

User-agent: Perplexity-User
Disallow: /

Meta AI / Facebook

According to Meta, Meta-ExternalAgent crawls the web to train AI models. Meta-ExternalFetcher fetches links on user request and may bypass robots.txt. The meta-webindexer, on the other hand, improves search in Meta AI. Only block it if you don't want to be cited there.

text
User-agent: Meta-ExternalAgent
Disallow: /

User-agent: Meta-ExternalFetcher
Disallow: /

Webz.io

text
User-agent: OmgiliBot
Disallow: /

Cohere

text
User-agent: cohere-ai
Disallow: /

xAI/SpaceXAI (Grok)

xAI has been part of SpaceX since February 2026 and now operates as SpaceXAI. You won't find a bot overview there like the ones from OpenAI, Anthropic, or Google. Blocklists use the strings GrokBot, xAI-Grok, and Grok-DeepSearch for Grok.

Add them, but don't rely on them. Only your server logs show whether Grok fetches respect your rules. For a hard block, you need a firewall rule:

text
User-agent: GrokBot
Disallow: /

User-agent: xAI-Grok
Disallow: /

User-agent: Grok-DeepSearch
Disallow: /

Apple (Apple Intelligence)

Applebot-Extended controls exclusively whether Apple may use your content to train Apple Intelligence. According to Apple, Applebot-Extended doesn't crawl pages itself. The token only determines how Apple may use the data collected by the regular Applebot. The Applebot for Spotlight, Siri, and Safari is unaffected.

text
User-agent: Applebot-Extended
Disallow: /

Amazon

According to Amazon, Amazonbot improves Amazon's products and services and may help train Amazon's AI models. Amazon publishes its crawler IP addresses and says its automated crawlers respect the Robots Exclusion Protocol.

Amazon also runs Amzn-SearchBot for search experiences like Alexa and Amzn-User for user-triggered fetches. Amazon says neither collects training data. Amzn-User may not follow all robots.txt directives.

text
User-agent: Amazonbot
Disallow: /

4. Selective Blocking

Sometimes you don't want to completely lock out AI crawlers, but only protect certain areas of your website.

No problem!

Blocking specific directories/pages for AI crawlers

If you have an area with exclusive content, you can exclude this from crawlers with the following code:

text
User-agent: GPTBot
Disallow: /exclusive/

User-agent: ClaudeBot
Disallow: /premium-content/

In this example, you're blocking GPTBot from your "/exclusive/" directory and Anthropic's crawler from "/premium-content/".

Defining exceptions

Sometimes you might want to block most of your site but make certain areas accessible to AI crawlers. Here's an example:

text
User-agent: GPTBot
Disallow: /
Allow: /blog/

User-agent: ClaudeBot
Disallow: /
Allow: /public/

In this case, you first block everything with Disallow: /, then allow specific areas with Allow.

So GPTBot is allowed to crawl your blog, while Anthropic's crawler can only access the public area.

5. Verification and Testing

Everything set up? Great!

But before you sit back, you should make sure your robots.txt is actually doing what it's supposed to.

Google provides the robots.txt report in Google Search Console for this.

robots.txt report in Google Search Console

It shows which robots.txt files Google found for your top hosts, when they were last crawled, and whether there are warnings or errors.

The report doesn't show how GPTBot, ClaudeBot, and others treat your rules. Check that in your server logs. Allow some lead time: OpenAI mentions about 24 hours for ChatGPT search, and Meta up to 24 hours, before a changed robots.txt takes effect.

Frequently Asked Questions About Blocking AI Crawlers

Add User-agent: GPTBot followed by Disallow: / to your robots.txt. That blocks only the training crawler. OAI-SearchBot (ChatGPT search) and ChatGPT-User need their own entries. If you block OAI-SearchBot, OpenAI says your site no longer appears in ChatGPT search answers.

Only those that honor it. Robots.txt is a crawl directive, not access control, so a crawler that ignores it can still fetch a public page. Use firewall rules or authentication when you need to prevent access. Blocking also does not remove copies that were already stored.

The main ones are GPTBot, OAI-SearchBot and ChatGPT-User from OpenAI, ClaudeBot, Claude-User and Claude-SearchBot from Anthropic, Google-Extended, CCBot from Common Crawl, PerplexityBot and Perplexity-User, and Applebot-Extended. Providers separate bots for training, search and user-triggered fetches, so you can block them individually.

The EU AI Act and the GPAI Code of Practice address different obligations:

  • EU AI Act: Article 53 requires providers of general-purpose AI models to maintain a policy for complying with EU copyright law, including rights reservations under Article 4(3) of the DSM Directive.
  • GPAI Code of Practice: Signatories commit to respect robots.txt under Measure 1.3.
  • Other options: Contract terms and technical controls may help, but their effect depends on the parties, jurisdiction, and enforcement.

The legal effect of a specific crawl, rights reservation, or contract depends on the facts and applicable law.

Yes, if you want to keep future pages out of Common Crawl archives: block CCBot in robots.txt. It won’t remove content from existing snapshots or copies others have already obtained.

Use authentication for private content, and firewall rules plus log monitoring for public pages. A noindex tag only affects search indexing and is neither an access block nor a training opt-out.

Not automatically. Training crawlers, search crawlers and user-triggered fetchers serve different purposes, so blocking a training bot does not remove you from AI search results. Blocking search bots such as OAI-SearchBot does.
FH

Finn Hillebrandt

AI Expert & Blogger

Finn Hillebrandt is the founder of Gradually AI, an SEO and AI expert. He helps online entrepreneurs simplify and automate their processes and marketing with AI. Finn shares his knowledge here on the blog in 50+ articles as well as through the AI Business Club.

Learn more about Finn and the team, follow Finn on LinkedIn, join his Facebook group for ChatGPT, OpenAI & AI Tools or do like 17,500+ others and subscribe to his AI Newsletter with tips, news and offers about AI tools and online business. Also visit his other blog, Blogmojo, which is about WordPress, blogging and SEO.