Blog
SavedSearch
Visit Hostlelo

Which AI crawlers can read your site? A robots.txt guide

Block AI training crawlers and stay visible in AI search. A step-by-step robots.txt guide using the bot tokens OpenAI, Anthropic and Google document.

The short answer

You control AI crawlers with separate User-agent groups in robots.txt, because OpenAI, Anthropic and Google each document different tokens for training, search and user-triggered fetches. Disallow GPTBot, ClaudeBot and Google-Extended to opt out of training, and allow OAI-SearchBot, Claude-SearchBot, ChatGPT-User and Claude-User to stay visible in AI search. Robots.txt is a request that well-behaved crawlers honour, so anything private still needs a password or noindex.

Reading options

On this page

The big AI companies now publish separate crawler names for model training, for AI search, and for pages fetched when a user asks, and your robots.txt file can give each of them a different answer. So you can say no to training and still let AI search tools find and cite your pages. By the end of this guide you will have backed up your current file, picked a rule for each documented bot, uploaded a clean robots.txt, and tested that it works.

What robots.txt actually is

Think of robots.txt as the sign on the gate of a building site. It says things like "visitors report to the office" and "no entry to the second floor". Polite visitors read it and follow it. The sign does not lock any door, and someone who ignores it can still walk in.

That is exactly how the standard describes it. RFC 9309, the document that defines the Robots Exclusion Protocol, says these rules are not a form of access authorization. Google says the same thing from its side: robots.txt is not a mechanism for keeping a page out of Google. If something must stay private, put it behind a password. If something must stay out of search results, use noindex.

The file is plain text and lives at the top of your site, at an address like https://example.com/robots.txt. Inside, it is made of groups. Each group starts with one or more User-agent lines that name a crawler, followed by Allow and Disallow lines that list paths.

A few rules from RFC 9309 matter a lot once you start writing groups for AI bots:

  • The crawler name in User-agent is matched without caring about upper or lower case, so gptbot and GPTBot are the same.
  • Paths are case-sensitive, so /Admin/ and /admin/ are different paths.
  • When an Allow and a Disallow rule both match a URL, the most specific rule wins, which means the longest one.
  • If the two matching rules are equally long, the Allow rule is used.
  • A crawler follows the group that names it. Only if no group names it does it fall back to the User-agent: * group.
  • If several groups name the same crawler, their rules are merged into one.

That fifth point catches a lot of people, and we will come back to it in the pro tips.

Before you start

Run through this short checklist so nothing surprises you halfway:

  • You can reach your site files through cPanel File Manager, SFTP or SSH.
  • You know your document root, the folder your domain serves files from. If that idea is new, read what web hosting is first.
  • You know every hostname you serve, such as example.com, www.example.com and any subdomain like blog.example.com. Our guide on mapping a host to a domain helps here.
  • You have checked whether your CMS or an SEO plugin creates robots.txt for you instead of a real file.
  • You know whether a CDN sits in front of your site.
  • You have curl on your computer or server.
  • You have a clear goal, for example "no training, but stay visible in AI search".
  • Optionally, you have a Google Search Console property at the domain level.

Step-by-step

Step 1: See what you have now

Before you change anything, look at the file the world sees today. Run this from any terminal:

curl -s https://example.com/robots.txt

If you get a list of rules, good, you have something to back up. If you get an HTML error page or nothing at all, you probably have no file. RFC 9309 says that when the robots.txt request returns a 4xx error, crawlers may access anything, so right now every bot treats your site as open.

Step 2: Back up the current file

Never edit this file without a copy. On SSH, or in the cPanel Terminal, copy it with today's date in the name:

cp ~/public_html/robots.txt ~/robots.txt.backup-2026-11-22

Change ~/public_html to your real document root if it is different. The backup sits outside the public folder, so nobody can download it. If something goes wrong later, you copy it back and you are where you started.

If the file is generated by a plugin, there is no real file to copy. In that case, save the output of Step 1 into a text file on your computer so you still have a record.

Step 3: Decide per bot

This is the real work. Each vendor uses different names for different jobs, and each name can be allowed or blocked on its own. At the time of writing (22 November 2026), these are the documented tokens.

From OpenAI's bots page:

  • GPTBot crawls content that may be used to train OpenAI's foundation models. Blocking it tells OpenAI not to use your content for training.
  • OAI-SearchBot is used to show sites in ChatGPT search. If you block it, your pages will not appear in ChatGPT search answers, though they can still show as navigational links.
  • ChatGPT-User visits a page when a ChatGPT user's request needs it. OpenAI says robots.txt rules may not apply to these user-initiated actions.
  • OAI-AdsBot validates the safety of web pages submitted as ads on ChatGPT. OpenAI says the data it collects is not used to train foundation models.

OpenAI also says each setting is independent, so blocking one does not block the others.

From Anthropic's help article:

  • ClaudeBot collects web content that may be used to train Anthropic's models. Blocking it signals that your future content should be left out of training data.
  • Claude-User fetches a page when a Claude user asks a question that needs it. Blocking it stops those fetches, which may reduce your visibility when people ask Claude about your topic.
  • Claude-SearchBot indexes content to improve search results for Claude users. Blocking it may reduce your visibility in those results.

From Google's list of common crawlers:

  • Google-Extended is a control token, not a crawler. It has no user-agent string of its own, because Google crawls with its usual user agents.
  • It controls whether content Google crawls may be used to train future Gemini models and for grounding, where Search content is given to Gemini at prompt time.
  • It does not affect whether your site is included in Google Search, and it is not a ranking signal. Blocking it will not remove you from Google.

Now ask yourself two plain questions. Do you want your pages used to train AI models? Do you want AI search tools to find, quote and link to your pages? The example in the next step answers "no" to the first question and "yes" to the second. If you answer differently, flip the matching Allow and Disallow lines.

Step 4: Write the file

Open a plain text editor, not a word processor, and create a file named exactly robots.txt in lowercase. Here is a complete file that opts out of training while staying visible in AI search:

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: Claude-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: Claude-User
Allow: /

User-agent: *
Disallow: /admin/

Sitemap: https://example.com/sitemap.xml

Here is what each part does, in plain words:

  • The first three groups ask the training crawlers and the Gemini training control to stay away from every path, because Disallow: / matches everything.
  • The next four groups welcome the search bots and the user-triggered fetchers to the whole site.
  • The User-agent: * group applies to every other crawler, such as normal search engines, and asks them to skip /admin/.
  • The Sitemap line points crawlers to your sitemap. Change the address to your real sitemap.

Replace example.com with your domain. Save the file as UTF-8 text. If you had rules in your old file that still matter, such as paths for a staging folder, copy them into the User-agent: * group.

Step 5: Upload it to the site root

The file must sit in the top folder of the host it controls, so https://example.com/robots.txt works. A file in a subfolder like /blog/robots.txt is ignored.

  • In cPanel, open File Manager, go to your document root, and upload robots.txt, replacing the old one.
  • With SFTP, upload it into the same document root.
  • With SSH, you can write it in place with an editor such as nano.

Make sure the web server can read it. On most shared hosting, a permission of 644 is right for a public file like this.

If you serve more than one hostname, repeat this for each. Anthropic notes that the file has to be in the top-level directory of each subdomain you want covered, so blog.example.com needs its own copy.

If a plugin was generating the file, either set the same rules inside the plugin, or turn off its robots.txt feature so your real file is served. Do not leave both fighting each other.

Step 6: Test it

First check the content. You should see exactly what you wrote:

curl -s https://example.com/robots.txt

Then check the headers:

curl -I https://example.com/robots.txt

You want to see HTTP/2 200 or HTTP/1.1 200, and a Content-Type that starts with text/plain. If you see a 404, a 500, a redirect to a login page, or text/html, jump to the troubleshooting section.

Variants

Apache servers

On Apache, a real robots.txt file in the document root is served as a static file with no extra setup. Most CMS rewrite rules in .htaccess only send requests to the CMS when no real file exists, so your file wins.

If you force HTTPS, the plain HTTP address will redirect, which is fine. RFC 9309 says crawlers should follow at least five consecutive redirects. Our guide on redirecting HTTP to HTTPS shows a clean way to set that up.

If your headers show the wrong content type, add this one line to the .htaccess file in your document root:

AddType text/plain .txt

Nginx servers

On Nginx, a static file in the root folder is usually served as is. If your site sends every request to an app, add an exact location block so robots.txt is always served from disk with the right type. Put this inside your server block:

location = /robots.txt {
    default_type text/plain;
    try_files $uri =404;
}

Then test the config and reload Nginx:

sudo nginx -t && sudo systemctl reload nginx

A site behind a CDN

A CDN can cache robots.txt like any other file, so your new rules may not show up straight away. After you upload, purge that one URL from the CDN cache, then run the curl tests again.

To check your origin server directly and skip the CDN, tell curl which IP to use. Replace 203.0.113.10 with your origin server's real IP:

curl -sI --resolve example.com:443:203.0.113.10 https://example.com/robots.txt

If the origin shows your new file but the public address shows the old one, it is a cache problem. If your CDN dashboard has bot or AI crawler settings, check what they do, because they can block bots before they ever read your file. Anthropic warns that blocking its IP addresses may not reliably opt you out, because the bots then cannot read your robots.txt at all.

How to check it worked

Start with the two curl commands from Step 6. A 200 status, a text/plain type and the exact rules you wrote mean the file itself is right.

Next, open the robots.txt report in Google Search Console. It works for domain-level properties, such as a Domain property for example.com or a URL-prefix property with no path. For each file it shows the fetch status, when Google last checked it, its size and any parsing issues. You can see the last version Google fetched and request a recrawl after you fix a serious error.

Then watch your access logs over the next days. On a VPS you can search for a bot by name:

grep -i "GPTBot" /var/log/nginx/access.log

On Apache the log is often at /var/log/apache2/access.log, and on cPanel you can download raw access logs from the Metrics section. A well-behaved bot will fetch /robots.txt and then stop requesting the paths you blocked.

Two things will not show in the logs. Google-Extended never appears, because it has no user agent of its own. And user-triggered fetchers like ChatGPT-User may still show up even when blocked, since OpenAI says the rules may not apply to user-initiated actions.

Be patient with search changes. At the time of writing (22 November 2026), OpenAI says it can take about 24 hours after a robots.txt update for its search systems to adjust.

Troubleshooting

The file returns a 404

Symptom: curl -I shows 404 Not Found.

Cause: The file is in the wrong folder, has the wrong name such as Robots.txt or robots.txt.txt, or a plugin intercepts the URL.

Fix: Put the file in the document root with the exact lowercase name, and check the plugin settings. Remember that RFC 9309 lets crawlers treat a 4xx as "access anything", so until this is fixed, none of your rules count.

The file returns a 5xx error

Symptom: curl -I shows 500, 502 or 503.

Cause: A broken rewrite rule, a crashed app, or a firewall rule that errors on this path.

Fix: Serve the file statically using the Apache or Nginx steps above and check your error log. This one is urgent, because RFC 9309 says a crawler that gets a server error must assume complete disallow, so good bots may stop crawling your whole site.

The file is served as HTML

Symptom: The Content-Type is text/html, or the body shows your site's page layout.

Cause: The CMS answers the request with a page because no real file exists, or the server has no type set for .txt.

Fix: Upload a real file, or add the AddType line for Apache or the default_type line for Nginx shown above.

A path rule does nothing

Symptom: A bot still requests /Admin/login even though you wrote Disallow: /admin/.

Cause: Paths are case-sensitive, so /admin/ does not match /Admin/.

Fix: Write the path exactly as it appears in your URLs, and add a second line if both forms exist.

Your search bots crawl your admin area

Symptom: OAI-SearchBot or Claude-SearchBot requests paths under /admin/.

Cause: These bots have their own groups, so they follow only those groups and skip the User-agent: * group entirely.

Fix: Add Disallow: /admin/ under each named group as well. The longer Disallow: /admin/ rule beats the shorter Allow: /, so the rest of the site stays open.

A subdomain is still crawled

Symptom: Your rules work on example.com but bots still crawl shop.example.com.

Cause: The rules apply per host, and the subdomain has its own robots.txt, or none.

Fix: Upload a copy to the top folder of each subdomain and test each one with curl.

A bot keeps visiting after you blocked it

Symptom: You still see a blocked name in your logs.

Cause: It may be a user-triggered fetcher, the change may not have been picked up yet, your CDN may still serve the old file, or the visitor may be faking the name.

Fix: Confirm the live file with curl, purge the CDN cache, and give it a day. If the traffic is still a problem, use server or firewall controls, keeping in mind that blocking a real vendor bot stops it from reading your rules.

Pro tips

  • Repeat any important Disallow lines inside every named group, because a named group replaces the * group for that bot.
  • Do not block the CSS or JavaScript files your pages need. Google says blocking them can make your pages harder for its crawler to understand.
  • Use # comments to note why a rule exists and when you added it. Future you will be grateful.
  • Keep the file short. RFC 9309 says a crawler's parsing limit must be at least 500 KiB, so staying well under that is safe.
  • Anthropic supports the non-standard Crawl-delay line for its bots if you want them to slow down. Pick a value that suits your server and test the load.
  • If you want a page out of search results, use noindex and let the page be crawled. A page blocked in robots.txt can still appear in Google without a description if other sites link to it.
  • Keep your dated backups. When a vendor adds a new bot name, you can compare old and new files line by line.
  • Recheck the vendor pages every few months. At the time of writing (22 November 2026), Google says it intends to support the AIPREF shared machine-readable training preference signal, written as user-agent: __usage_ai-training, in early 2027.

The one message worth forwarding

If someone on your team or a client asks about AI bots, you can send them this as is:

Our robots.txt now tells AI training crawlers (GPTBot, ClaudeBot and Google-Extended) not to use our site, while AI search bots and user requests (OAI-SearchBot, Claude-SearchBot, ChatGPT-User, Claude-User) are allowed. Google-Extended does not affect our Google Search ranking. This is a request that well-behaved bots honour, not a lock, so anything private still needs a password.

Takeaway: Give each AI bot its own line in robots.txt, test the file with curl, and treat it as a polite sign on the gate rather than a lock.

Reader questions

Does blocking Google-Extended remove my site from Google Search?

No. Google says Google-Extended does not affect inclusion in Google Search and is not a ranking signal. It only controls use of your content for training Gemini models and for grounding.

Can robots.txt stop an AI company from reading my pages?

No. RFC 9309 says robots.txt rules are not access authorization, so the file is a request that well-behaved crawlers honour. Use a password for anything that must stay private.

What is the difference between GPTBot and OAI-SearchBot?

OpenAI uses GPTBot to crawl content that may be used to train its models, and OAI-SearchBot to show sites in ChatGPT search. Each setting is independent, so you can block one and allow the other.

Why do I still see ChatGPT-User in my logs after blocking it?

ChatGPT-User acts when a user asks a question that needs your page. OpenAI says robots.txt rules may not apply to such user-initiated actions, so some visits can continue.

Do I need a separate robots.txt for each subdomain?

Yes. Anthropic says the file must be in the top-level directory of each subdomain you want covered, so blog.example.com needs its own copy.

What happens if my robots.txt returns a server error?

RFC 9309 says a crawler that gets a 5xx error must assume complete disallow. That can stop good crawlers from visiting your whole site until the error is fixed.

How long do changes take to apply?

OpenAI says it can take about 24 hours after a robots.txt update for its search systems to adjust. A CDN cache can add more delay, so purge the file after each change.

Sources & further reading

  1. RFC 9309: Robots Exclusion Protocol
  2. Google Search Central: Introduction to robots.txt
  3. Google Search Central: Google's common crawlers
  4. OpenAI: Overview of OpenAI crawlers
  5. Anthropic: Does Anthropic crawl data from the web, and how can site owners block the crawler?
  6. Search Console Help: robots.txt report

Originally published . About our editorial updates.

Your next project deserves a better foundation.

Explore hosting built for your next chapter.

Explore hosting

Find your next answer.

Search published guides and articles.

Ctrl / ⌘ K to open · Esc to close