Skip to main content
gradually.ai logogradually.ai
Blog
About Us
Subscribe to AI Newsletter
AI Newsletter
  1. Home
  2. AI Blog

How to Block OpenAI/ChatGPT, Anthropic & Co. 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
August 7, 2024
Auf Deutsch lesen
AI Application
How to Block OpenAI/ChatGPT, Anthropic & Co. Crawlers with robots.txt
𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
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, and Google-Extended
  • Use selective blocking to protect only certain areas while keeping others accessible
  • Test your configuration with Google Search Console and combine robots.txt with additional protection measures for maximum security

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: don't add a file extension like .txt!)

2.2 Setting Up the Basic Structure

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

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

For starters, you could write something like this:

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.

Warning
Any change to robots.txt can affect how your website is indexed. So proceed carefully and test your changes thoroughly.

3. Blocking Specific AI Crawlers

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

OpenAI (ChatGPT)

OpenAI has a total of three different crawlers that serve different functions. To prevent content theft as effectively as possible, you should exclude all of them:

User-agent: OAI-SearchBot
Disallow: /

User-agent: ChatGPT-User
Disallow: /

User-agent: GPTBot
Disallow: /

Anthropic (Claude)

User-agent: ClaudeBot
Disallow: /

User-agent: anthropic-ai
Disallow: /

Google (Bard/Gemini)

User-agent: Google-Extended
Disallow: /

Common Crawl

User-agent: CCBot
Disallow: /

Perplexity

User-agent: PerplexityBot
Disallow: /

Meta AI / Facebook

User-agent: FacebookBot
Disallow: /

User-agent: Meta-ExternalAgent
Disallow: /

User-agent: Meta-ExternalFetcher
Disallow: /

Webz.io

User-agent: OmgiliBot
Disallow: /

Cohere

User-agent: cohere-ai
Disallow: /
Note
Although many reputable companies respect robots.txt rules, there's no guarantee that all crawlers will comply.

5. 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:

User-agent: GPTBot
Disallow: /exclusive/

User-agent: anthropic-ai
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:

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

User-agent: anthropic-ai
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.

6. 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 you with a great tool for this: The robots.txt Tester in Google Search Console.

robots.txt Tester in Google Search Console

Here you can see if your robots.txt can be properly fetched by Google and if it contains any errors.

Frequently Asked Questions About Blocking AI Crawlers

𝕏XShare on XFacebookShare on FacebookLinkedInShare on LinkedInPinterestShare on PinterestThreadsShare on ThreadsFlipboardShare on Flipboard
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 his ChatGPT Course and 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.

Similar Articles

The 6 Best AI SEO Tools in 2026
AI Application

The 6 Best AI SEO Tools in 2026

August 27, 2024
FHFinn Hillebrandt
How to Turn Images into AI Videos (Step by Step)
AI Application

How to Turn Images into AI Videos (Step by Step)

July 3, 2024
FHFinn Hillebrandt
5 AI Tools to Create TikToks, Reels & Shorts (+ Bonus)
AI Application

5 AI Tools to Create TikToks, Reels & Shorts (+ Bonus)

June 11, 2024
FHFinn Hillebrandt
Do You Have to Label AI Content? And If So, How?
AI Application

Do You Have to Label AI Content? And If So, How?

June 10, 2024
FHFinn Hillebrandt
10 Brilliant Ways to Use ChatGPT for YouTube
AI Application

10 Brilliant Ways to Use ChatGPT for YouTube

May 17, 2024
FHFinn Hillebrandt
10 Ways to Use ChatGPT for TikTok
AI Application

10 Ways to Use ChatGPT for TikTok

March 27, 2024
FHFinn Hillebrandt

Stay Updated with the AI Newsletter

Get the latest AI tools, tutorials, and exclusive tips delivered to your inbox weekly

Unsubscribe anytime. About 4 to 8 emails per month. Consent includes notes on revocation, service provider, and statistics according to our Privacy Policy.

gradually.ai logogradually.ai

Germany's leading platform for AI tools and knowledge for online entrepreneurs.

AI Tools

  • AI Chat
  • ChatGPT in German
  • Text Generator
  • Prompt Enhancer
  • FLUX AI Image Generator
  • AI Art Generator
  • Midjourney Prompt Generator
  • Veo 3 Prompt Generator
  • AI Humanizer
  • AI Text Detector
  • Gemini Watermark Remover
  • All Tools →

Creative Tools

  • Blog Name Generator
  • AI Book Title Generator
  • Song Lyrics Generator
  • Artist Name Generator
  • Team Name Generator
  • AI Mindmap Generator
  • Headline Generator
  • Company Name Generator
  • AI Slogan Generator

Business Tools

  • API Cost Calculator
  • Token Counter
  • AI Ad Generator
  • AI Copy Generator
  • Essay Generator
  • Story Generator
  • AI Rewrite Generator
  • Blog Post Generator
  • Meta Description Generator
  • AI Email Generator

Resources

  • MCP Server Directory
  • Agent Skills
  • n8n Hosting Comparison
  • OpenClaw Hosting Comparison

© 2025 Gradually AI. All rights reserved.

  • Blog
  • About Us
  • Legal Notice
  • Privacy Policy