Skip to the content

Contact usFree tools · No signup · Files stay on your device

SEO & Marketing

How to block AI crawlers like GPTBot with robots.txt

How to block AI crawlers like GPTBot with robots.txt

AI companies run crawlers that read public websites, some to train models and some to fetch pages when a user asks a question. If you would rather they stayed away from your articles, product photos or course material, the standard way to say so is a few lines in your robots.txt file. The quickest route is the Robots.txt Generator, which has a "Block AI crawlers" tick box. This post shows the exact lines it writes, explains what each crawler is for, and tells you what you give up by blocking.

The short version

To ask OpenAI's GPTBot to stay out of your whole site, add these two lines to robots.txt:

User-agent: GPTBot
Disallow: /

User-agent names the crawler and Disallow: / means "nothing on this site". Repeat the pair for every crawler you want to block, or put several User-agent lines above a single Disallow: / to cover them all at once.

Block them all with the generator

  1. Open Robots.txt Generator.
  2. Press the "Block AI crawlers" preset button, or tick "Block AI crawlers (16: GPTBot, ClaudeBot, Google-Extended, CCBot…)".
  3. Leave Default on "Allow crawling" so normal search engines are unaffected.
  4. If you have a sitemap, type its full address in "Sitemap URLs".
  5. Press Copy or Download, then upload the file to the root of your site.

With nothing else filled in, the file you get is:

# AI crawlers (training and AI answers)
User-agent: GPTBot
User-agent: ChatGPT-User
User-agent: OAI-SearchBot
User-agent: ClaudeBot
User-agent: Claude-User
User-agent: anthropic-ai
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: CCBot
User-agent: PerplexityBot
User-agent: Bytespider
User-agent: Meta-ExternalAgent
User-agent: Amazonbot
User-agent: cohere-ai
User-agent: Diffbot
User-agent: ImagesiftBot
Disallow: /

User-agent: *
Allow: /

The first group applies to all 16 names at once. The second group, User-agent: * with Allow: /, is for every other crawler and keeps them welcome. The line starting with # is a comment that crawlers skip.

What the 16 names are

The tool uses each company's published user-agent name. As the companies describe them, they fall into a few kinds:

Kind Names in the list Blocking it means
Model training GPTBot, ClaudeBot, anthropic-ai, CCBot, Bytespider, Meta-ExternalAgent, cohere-ai, ImagesiftBot Your pages are not collected for training sets
Opt-out tokens Google-Extended, Applebot-Extended Google and Apple are told not to use your content for their AI features; their normal search crawlers are not affected
AI search and answers OAI-SearchBot, PerplexityBot, Amazonbot Your site may not be listed or cited in those products
Fetch on request ChatGPT-User, Claude-User The assistant cannot open your page when a user pastes a link or asks about it
Data services Diffbot Your pages are not collected for its data products

Read the table before you tick the box. The checkbox blocks all 16, including the ones that work like search engines. If you want to be mentioned in AI answers, you probably do not want OAI-SearchBot, PerplexityBot, ChatGPT-User or Claude-User in the blocked list.

Block only some of them

The generator has no list of individual bots to untick, so the easy way is to edit the output. Copy the text into any editor and delete the lines you do not want. For example, to block training crawlers but leave AI search and fetch-on-request bots alone:

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
Disallow: /

User-agent: *
Allow: /

Then paste the edited file into the Robots.txt Tester to check it before you upload.

Block only part of your site

You do not have to block everything. To keep GPTBot out of a members-only folder and your photo gallery, but let it read the blog:

User-agent: GPTBot
Disallow: /members/
Disallow: /gallery/

The generator's path boxes apply to all crawlers, not to one named bot, so for a rule aimed at a single bot you write the group by hand like this and check it in the Tester.

Test that it works

  1. Open Robots.txt Tester.
  2. Paste your file into "robots.txt (editable)", or type your domain and press "Fetch robots.txt" once the file is live.
  3. Under "3. Test URLs", choose GPTBot (OpenAI) in the crawler list and enter a path such as /blog/my-post.
  4. The Results table should show Blocked, with the matching rule Disallow: / and its line number.
  5. Switch the crawler to Googlebot and test the same path. It should show Allowed, with "No rule matches (allowed by default)" or your Allow: / line, so search traffic is safe.

The tester also tells you which group applied: for the full list above it reads "Rules for GPTBot come from the group on line 2", meaning the group that starts at the first User-agent line. For a crawler that is not in the dropdown, such as one you saw in your server logs, choose "Custom…" and type its name.

Limits you should know about

  • It is a request, not a lock. Reputable crawlers follow robots.txt. Others do not, and a crawler can also pretend to be a browser. If a bot ignores you, block it at the server or firewall, not in this file.
  • It is not retroactive. Robots.txt does not delete anything already collected. It only governs future visits.
  • It does not hide pages from people. Anyone with the link can still open a blocked page.
  • Caches take time. Crawlers may keep using an older copy of robots.txt for a while, so a new rule is not instant.
  • New bots appear. The list in the tool covers published names today. Check your server logs now and then for new ones and add them.

Should you block AI crawlers?

It depends on what your site is for. A publisher with original articles or a photographer selling prints may want control over reuse. A local business, a government-job information site or a shop that wants customers to find it through AI assistants may gain by staying open, because a blocked site cannot be cited. There is no right answer, and you can change the file at any time.

If you do block, keep everything else in robots.txt tidy: your normal rules for admin and cart pages, and your sitemap line. The complete guide to writing robots.txt covers those, and the Sitemap Generator makes the sitemap.

Quick checklist

  • Add one group with every bot you want to block, ending in Disallow: /.
  • Keep a separate User-agent: * group so search engines stay unaffected.
  • Decide whether to block search and fetch bots as well as training bots.
  • Test GPTBot and Googlebot in the Robots.txt Tester.
  • Upload the file to your site's root and check that /robots.txt opens.

Frequently asked questions

Will blocking GPTBot remove my site from Google?
No. GPTBot is OpenAI's crawler and has nothing to do with Googlebot. Google Search keeps crawling your site as before unless you block Googlebot itself.
Does blocking Google-Extended hurt my search ranking?
No. Google-Extended is a control token for Google's AI training use, not a crawler that ranks pages. Googlebot is a separate user agent, so Google Search is not affected.
Do all AI crawlers obey robots.txt?
Well-behaved ones do. Robots.txt is a request, not a lock, so a crawler that ignores it can still read your pages. To stop those you need a block at the server or firewall level.
Will this remove content that was already collected?
No. Robots.txt only tells crawlers what to do from now on. It does not delete anything a company has already gathered.
Can I block only the training bots and keep AI search visibility?
Yes. Block the training crawlers such as GPTBot and ClaudeBot, and leave search and user-request bots like OAI-SearchBot, ChatGPT-User and Claude-User out of the file.
Found this useful? Share it

Tools in this guide

Main tool

Robots.txt Generator

Build a robots.txt file from presets and simple choices: block AI crawlers, keep admin and cart pages out of search, add your sitemap,.

Open tool

Robots.txt Tester

Check whether a crawler is allowed to visit a URL.

Open tool

Sitemap Generator

Paste your page URLs and get a standards-compliant sitemap.xml in seconds.

Open tool

Back to all guides & blog