Guides · Updated 2026-10-19

robots.txt vs Cloudflare AI bot blocking

robots.txt states a preference; Cloudflare's AI bot settings enforce one at the edge. How the two interact, where they conflict, and how to set them so the crawlers you want can still get in.

If your site sits behind Cloudflare, two separate things decide whether an AI crawler gets your content: your robots.txt file and Cloudflare's own bot settings. They look like they do the same job. They don't, and when they disagree, the stricter one wins.

robots.txt is a request

robots.txt tells crawlers what you'd like them to do. Cloudflare's documentation puts it plainly: robots.txt compliance is voluntary. The file expresses your preferences, but it doesn't stop a crawler from fetching your pages at a technical level, and some operators ignore it (Cloudflare: robots.txt setting).

The big AI companies say they honor it. OpenAI, for example, documents a separate robots.txt token for each crawler, so you can allow OAI-SearchBot for ChatGPT search while disallowing GPTBot for training (OpenAI's crawler documentation). That fine-grained control is the main reason to get robots.txt right.

Cloudflare blocking is enforcement

Cloudflare's settings act on the request itself. A blocked crawler never reaches your origin, whatever your robots.txt says. There are two places to set this up.

Cloudflare can also write your robots.txt

With Bot Preference Sync turned on, Cloudflare generates managed robots.txt directives from your AI bot policies. If your origin already serves a robots.txt, Cloudflare puts its managed block in front of your file and serves the two as one response. If you have none, it creates one. The managed section can include Disallow rules for crawlers such as GPTBot, ClaudeBot and Google-Extended, plus Content Signals lines such as search=yes, ai-train=no (Cloudflare: robots.txt setting).

That's handy, but it means the robots.txt you edit in your code may not be the one crawlers actually receive. Always check the live file at yoursite.com/robots.txt, not the one in your repository.

Where they conflict

The common problem cases:

A sensible setup

  1. Decide per purpose: do you want to appear in AI search answers, and do you want to allow training? Many sites say yes to search and no to training.
  2. Set the Cloudflare AI bot policies to match. Leave Search allowed if you want to be found.
  3. Write robots.txt to say the same thing, with a group for each crawler you care about.
  4. Look at the live robots.txt and AI Crawl Control afterwards to confirm the crawlers you allowed are actually getting 200 responses.

Keep in mind that a firewall block is the only option here that actually stops a crawler that ignores the rules. robots.txt only works for the ones that choose to listen.

See what crawlers actually get

The free check below reads your live robots.txt for 21 AI crawlers, then fetches your homepage as a browser and as AI crawler user agents, and flags when a firewall or CDN answers them differently.

1 free check a day per person (per browser) · works without JavaScript · no signup

Sources

More guides