Skip to content

Robots.txt for AI Crawlers: A Complete Configuration Guide

Small robots passing a red gate next to a page of rules, illustrating robots.txt for AI crawlers

Robots.txt for AI crawlers is now one of the most important files on a business website. It decides which AI companies can train on your content, which can index it for AI search and which can fetch pages when a user asks a question. Get it wrong, and you can disappear from ChatGPT or Perplexity answers without noticing.

This guide explains the main AI user agents, how to allow search while restricting training, and how to validate your rules. It ends with copy-and-paste templates for three common policies.

What is the difference between search crawlers and AI training crawlers?

Short answer: Search crawlers index pages so they can appear and be cited in search results and AI answers. Training crawlers collect content that may be used to train AI models. Several AI companies now run them as separate bots, so you can treat them differently.

Most AI companies now use a three-part model. One bot collects training data, one indexes content for search, and one fetches pages when a user asks the assistant to read them. As Search Engine Land explains in its coverage of how Anthropic’s Claude bots work, blocking one of these bots does not block the others.

That split is what makes a nuanced robots.txt for AI crawlers possible. In short, blocking AI training crawlers does not have to mean blocking AI search visibility.

Which AI crawlers should robots.txt address?

Short answer: Start with GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, PerplexityBot, Perplexity-User, Googlebot, Google-Extended and Bingbot. Together they cover the main AI search and training systems.

User agent Company Purpose Notes
GPTBot OpenAI Model training Blocking it does not remove you from ChatGPT search
OAI-SearchBot OpenAI ChatGPT search Block it and you stop appearing in ChatGPT search answers
ChatGPT-User OpenAI User-requested fetches Not an automatic crawler
ClaudeBot Anthropic Model training Excludes future content from training when blocked
Claude-SearchBot Anthropic Search indexing Blocking may reduce visibility in Claude search
Claude-User Anthropic User-requested fetches Anthropic says it honors robots.txt
PerplexityBot Perplexity Search indexing Perplexity says it is not used for model training
Perplexity-User Perplexity User-requested fetches Generally ignores robots.txt, per Perplexity
Googlebot Google Search, including AI Overviews Blocking it removes you from Google Search
Google-Extended Google Use in Gemini and other AI systems A control token, not a separate crawler
Bingbot Microsoft Bing search and Copilot Keep allowed for Bing and Copilot visibility

Check each vendor’s own page before you publish robots.txt for AI crawlers, because names and behavior change. Key references are OpenAI’s crawler documentation, Anthropic’s crawler help page and Perplexity’s bot guide.

How do you allow AI search while restricting model training?

Short answer: Disallow the training bots by name, allow the search bots by name and keep Googlebot and Bingbot open. Then decide separately about user-triggered fetchers, since some of them do not follow robots.txt.

The logic behind robots.txt for AI crawlers is simple. Name each bot you want to block, and give it Disallow: /. Name each search bot you want to allow, and give it the same rules as your general crawlers. Google-Extended works the same way: disallowing it limits use of your content in Gemini and other Google AI systems, while Googlebot keeps your site in Search, including AI Overviews.

Two limits are worth knowing. First, robots.txt is a request, not a lock, so it relies on bots that choose to follow it. Second, user-requested fetchers behave differently across vendors. Perplexity says its user fetcher generally ignores robots.txt, so a firewall rule is the only firm block there.

Production-ready robots.txt templates for AI crawlers

Short answer: Pick the template that matches your company’s policy, replace the domain and admin paths, and test it before you publish. Each template below has been checked with Python’s robots.txt parser.

Policy A: allow everything, including training

# Policy A: allow all crawlers, including AI training
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

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

Policy B: allow search and AI search, block model training

This is the most common choice for B2B companies. It keeps you visible in Google, Bing, ChatGPT, Claude and Perplexity search, while opting out of training where vendors support it.

# Policy B: allow search and AI search, block model training
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
Disallow: /

User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

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

Policy C: block all AI bots, keep classic search

Use this only if legal or content licensing reasons require it. You will lose visibility in AI search products outside Google and Bing.

# Policy C: keep classic search, block AI training and AI search bots
User-agent: GPTBot
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: ClaudeBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: Google-Extended
Disallow: /

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

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

What are common mistakes in robots.txt for AI crawlers?

Short answer: The most common mistakes are assuming named groups inherit the wildcard rules, blocking search bots by accident, using the wrong bot name and forgetting that a CDN or firewall can override everything.

  • Named groups do not inherit the wildcard group. When a bot matches its own User-agent group, it ignores the User-agent: * rules. So repeat any path restrictions, such as admin folders, inside each named group.
  • Blocking GPTBot and thinking it controls ChatGPT search. Search uses OAI-SearchBot, which needs its own rule.
  • Typos in user agent names. A misspelled name silently matches nothing.
  • One file for every subdomain. Each subdomain needs its own robots.txt.
  • Firewall blocks. Bot protection at the CDN can block crawlers that robots.txt allows.

We caught the first mistake while testing Policy B. Without the repeated admin rule, the parser allowed OAI-SearchBot into the admin folder even though the wildcard group blocked it.

How do you validate robots.txt for AI crawlers?

Short answer: Test the file with a robots.txt parser, confirm it is live at the root of each domain and check server logs to see how real crawlers respond. Repeat after every change.

This short Python check shows what each bot is allowed to fetch under your rules:

from urllib.robotparser import RobotFileParser

BOTS = ["Googlebot", "Bingbot", "OAI-SearchBot", "GPTBot", "Claude-SearchBot",
        "ClaudeBot", "PerplexityBot", "Google-Extended"]
URLS = ["https://www.example.com/blog/", "https://www.example.com/wp-admin/"]

rp = RobotFileParser()
rp.parse(open("robots.txt", encoding="utf-8").read().splitlines())
for bot in BOTS:
    print(f"{bot:<18}", "  ".join(f"{u.split('.com')[1]}={rp.can_fetch(bot, u)}" for u in URLS))

Next, confirm that real traffic matches. Search your server logs for each user agent and look for 403 or 429 responses, which usually mean a firewall is blocking a bot that robots.txt allows. Our guide to the technical AEO checklist covers the related checks. OpenAI also notes that robots.txt changes can take about 24 hours to apply.

Frequently asked questions about robots.txt for AI crawlers

Does blocking GPTBot remove my site from ChatGPT?

No. GPTBot is OpenAI’s training crawler. ChatGPT search uses OAI-SearchBot, which you can allow separately.

Does Google-Extended affect AI Overviews?

No. AI Overviews and AI Mode are part of Google Search and depend on Googlebot. Google-Extended controls use in Gemini and other Google AI systems outside Search.

Can robots.txt for AI crawlers stop all AI access?

Not fully. Robots.txt depends on bots choosing to follow it, and some user-triggered fetchers do not. Use firewall rules with published IP ranges if you need a hard block.

Where should robots.txt live?

At the root of each host, for example www.example.com/robots.txt. Every subdomain needs its own file.

How often should we review robots.txt for AI crawlers?

Review it every quarter and whenever a vendor announces a new bot. AI companies have changed and added user agents several times since 2024.

Next step

Choose a policy with your legal and marketing teams, apply the matching template and test it with the script above. For broader context, see our guide on how to get your website on ChatGPT.

Want more practical guides on robots.txt for AI crawlers? Browse the latest articles on the Blippu blog.

See all articles