How to Set Up a Robots.txt File for AI Crawlers

Written by the Seolyn team8 min read
How to Set Up a Robots.txt File for AI Crawlers

Key takeaway

A robots.txt file for AI crawlers is a plain text file at yourdomain.com/robots.txt that names specific bot user-agents (like GPTBot, ClaudeBot, or PerplexityBot) and tells each one whether it can crawl your site, using Allow and Disallow rules under User-agent blocks. It does not grant or revoke legal permission to use your content, and it can't stop a crawler that ignores it — it's a request, not a lock.

Key takeaways

  • Each AI company runs its own named crawler (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, Applebot-Extended) — a single blanket Disallow: / blocks all of them, but you usually want to block some and allow others.
  • Training crawlers and answer-engine (retrieval) crawlers are often different bots from the same company — blocking the wrong one can get you excluded from AI Overviews or ChatGPT citations without reducing training exposure at all.
  • Robots.txt is advisory, not enforced — it's read by cooperative bots, cached for up to 24 hours by most major crawlers, and does nothing against scrapers that don't identify themselves.

What robots.txt actually controls — and what it doesn't

Robots.txt follows the Robots Exclusion Protocol, which became an actual IETF standard in 2022 as RFC 9309. Before that it was a 30-year-old gentleman's agreement that most reputable crawlers honored anyway. The file lives at the root of your domain, it's checked before a crawl, and it works on a per-user-agent basis — meaning you're not writing one global rule, you're writing a separate instruction set for each named bot.

What it doesn't do: it doesn't remove content already indexed or already used in a training set, it doesn't apply retroactively, and it doesn't stop a crawler that simply doesn't check the file (plenty of scraping operations, especially ones feeding smaller or overseas LLMs, don't bother). If you want content legally excluded from use, robots.txt is the wrong tool — that's a terms-of-service and licensing question, not a crawl-directive question.

The AI crawlers worth naming explicitly

Generic advice tells you to "block AI bots." The problem is there's no single "AI bot" — there are at least a dozen distinct user-agents, and they split into two categories that matter for completely different reasons:

Training crawlers (scrape content to build or update a model):

  • GPTBot — OpenAI's training crawler
  • CCBot — Common Crawl, whose dataset feeds many open and closed models indirectly
  • Google-Extended — controls whether Google can use your content for Gemini/AI training, separate from regular Googlebot indexing
  • Bytespider — ByteDance
  • Applebot-Extended — modifies what Apple Intelligence can use, separate from regular Applebot indexing

Answer/retrieval crawlers (fetch content live to answer a specific user query, often triggering a citation):

  • ChatGPT-User — fires when a ChatGPT user asks something that triggers a live browse
  • PerplexityBot — crawls for both indexing and live retrieval
  • ClaudeBot — Anthropic's crawler, used for both training and Claude's web-browsing feature depending on context
  • Amazonbot — Alexa and related retrieval

This split is the part most founders miss. Blocking GPTBot stops OpenAI from using your pages in future model training — it does nothing to stop ChatGPT from citing your page when a user asks it a live question, because that's ChatGPT-User, a different agent entirely. If your goal is GEO (showing up as a cited source in AI answers), you generally want the retrieval bots allowed even if you've decided to block training bots.

Step-by-step: writing the file

  1. Check if a robots.txt file already exists at yourdomain.com/robots.txt. If it does, you're editing, not creating from scratch.
  2. Decide your policy per crawler — not one blanket policy. A reasonable default for a SaaS blog trying to get cited: allow retrieval bots, block or allow training bots based on your own tolerance for being used in model training.
  3. Write blocks like this:
User-agent: GPTBot
Disallow: /

User-agent: ChatGPT-User
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Google-Extended
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: *
Allow: /
  1. Place rules from most specific to least specific — bots match the most specific User-agent block that applies to them, not a merge of all matching blocks.
  2. Upload to the root directory (not a subfolder — yourdomain.com/blog/robots.txt is ignored).
  3. Reference your sitemap at the bottom with Sitemap: https://yourdomain.com/sitemap.xml so crawlers that are allowed in can actually find your pages efficiently.

If you publish through a CMS or static site generator, this file is usually editable directly in the project's public folder — Next.js, Astro, and most frameworks serve anything in /public at the root automatically.

The GEO trade-off nobody states plainly

Here's the actual tension: every AI company's retrieval crawler is also, in practice, a lightweight signal that your content exists and is fetchable right now. Sites that block everything indiscriminately — a common reflex after reading a scary headline about AI "stealing content" — often don't realize they've also blocked themselves out of Perplexity citations and ChatGPT's browsing feature, two of the fastest-growing referral sources for early-stage SaaS content in the last two years.

The inverse mistake is just as common: leaving training crawlers wide open because nobody configured anything, then being surprised that a competitor's Google Trends-chasing content strategy — the kind covered in how to find content ideas from search trend data — ends up training the same models your prospects are now asking questions in, using your original research as the raw material. There's no universally correct answer here; it's a bet on whether you'd rather be invisible to training data or invisible to citations. Most SaaS founders we talk to at Seolyn end up allowing retrieval bots and blocking training bots, because citations drive traffic now and training exposure has an unclear payoff years out.

Common mistakes that quietly break this

  • Blocking * (the wildcard) by accident. A rule under User-agent: * applies to every crawler that doesn't have its own named block, including Googlebot for regular search. This is the single most common way a site accidentally deindexes itself.
  • Assuming robots.txt updates propagate instantly. Google's own documentation on robots.txt notes that crawlers typically cache the file for up to 24 hours, per Google Search Central — so a change you made five minutes ago may not be respected yet.
  • Forgetting that meta robots tags and robots.txt do different jobs. Robots.txt stops crawling; a noindex meta tag stops indexing of a page that's already been crawled. Using only one when you meant the other is a frequent cause of pages that vanish from search but keep showing up in an AI tool's citations, or vice versa.
  • Never auditing old content that's still crawlable junk. If your blog has years of thin or outdated posts, every crawler — training or retrieval — is spending part of its crawl budget on pages that don't help you get cited. This is the same logic behind deciding which old posts are worth pruning: fewer, stronger pages means a higher proportion of what gets crawled is actually worth citing.

How to verify it's actually working

Pull your server logs (or a CDN dashboard like Cloudflare's, which breaks out bot traffic by name) and filter for the user-agent strings above. Cloudflare has published data showing AI crawler traffic has grown fast enough that many sites now see more requests from AI bots than from a mid-sized human referral source — which is exactly why guessing isn't good enough; you need to see which bots are actually hitting you before you decide what to block.

Cross-reference that against your actual analytics. If you're already pulling blog performance data for content decisions, the same GA4 setup used for tracking which posts earn organic traffic can help you spot referral traffic coming from perplexity.ai or chat.openai.com links — that's your confirmation the retrieval bots you allowed are actually converting into citations, not just crawling for nothing.

Frequently Asked Questions

Q: Does blocking GPTBot stop ChatGPT from citing my website?

No. GPTBot is OpenAI's training crawler. Citations inside a live ChatGPT conversation come from a separate crawler, ChatGPT-User, which fires only when a user's question triggers a real-time browse. You can block one and allow the other independently.

Q: Will a robots.txt file stop AI companies from using content I've already published?

No. Robots.txt only affects future crawling behavior from the moment the bot next reads the file. It has no effect on content already scraped, already indexed, or already incorporated into a trained model.

Q: Is it bad for SEO to block AI crawlers but allow Googlebot?

Not necessarily — Googlebot (regular search indexing) and Google-Extended (AI training) are separate user-agents, so blocking one doesn't affect the other. You can keep full Google Search visibility while opting out of AI training use.

Q: How do I know if an AI crawler is actually respecting my robots.txt rules?

Check your server or CDN logs for the specific user-agent string and compare request volume before and after your change. Reputable crawlers from major labs generally comply with RFC 9309, but there's no independent audit that guarantees every bot does — smaller or less transparent scrapers may ignore it entirely.

Q: Should every SaaS blog block all AI crawlers by default?

Not if getting cited in AI answers (GEO) matters to your traffic strategy. Blocking everything removes you from Perplexity, ChatGPT browsing, and similar citation sources along with training crawlers — most sites get better results allowing retrieval bots and deciding on training bots separately.

Want content like this on autopilot?

Seolyn researches keywords, writes the articles, and publishes on a schedule. The first one is written the moment you create a site.