Robots.txt for AI Crawlers in 2026: How to Control Training vs Indexing Without Breaking SEO

Mika Sandgrove | | 5 min read

Robots.txt for AI Crawlers in 2026: How to Control Training vs Indexing Without Breaking SEO

Intro: Control training vs indexing without breaking SEO

You can discourage AI training crawlers without blocking Googlebot—if you treat training ingestion and search indexing as different goals and write rules for each.

The constraint: robots.txt is not access control. It’s guidance for compliant bots; scrapers (and some “AI” traffic) can ignore it.

Below is a safe, testable robots.txt approach: copy‑paste patterns you adapt from real user agents in your logs, plus a rollout method with verification and a rollback plan so indexing stays intact. Bot ecosystems change, so plan to review and update your rules instead of assuming one file will stay correct forever.

Step 1 — What “AI crawlers” means in 2026 (training vs indexing)

“AI crawlers” usually means one of two things:

  1. Search indexing / discovery: search engine crawlers (for example, Googlebot and Bingbot) fetching pages to index and rank.
  2. AI training / dataset collection: crawlers collecting content to build or refresh LLM datasets.

The decision is different because the intent is different: indexing bots support acquisition; training crawlers are typically a content governance call.

In practice you identify bots by:

  • Declared user agent in requests (what you match in robots.txt).
  • Verification of identity, because user agents can be spoofed.

robots.txt can influence only bots that choose to comply. It won’t stop spoofing or non-compliant scraping, so treat verification (reverse DNS/IP checks where available) as part of the workflow.

Step 2 — A safe robots.txt strategy that preserves SEO

SEO safety rails:

  • Keep Googlebot and Bingbot allowed to the content that drives organic traffic.
  • Avoid a global block like User-agent: * with Disallow: / unless you truly mean “nothing should be crawled.”
  • Don’t use broad user-agent patterns that might catch legitimate crawlers.

Denylist vs allowlist:

  • Denylist (recommended default): allow by default, then disallow only specific, verified AI training user agents you’ve actually seen in logs. Lowest SEO risk, but unknown AI crawlers still get access.
  • Allowlist (high-risk): block User-agent: * and allow only a short list of “approved” bots. This can quietly break other legitimate crawlers (regional engines, preview tools, ad verifiers) and future search features.

When I ran these audits, the safest rule was simple: only add a user-agent group if you can point to real requests in logs (and ideally confirm IP ownership). That avoids blocking bots you never had.

Goal Best robots.txt approach Main risk
Block known AI training crawlers sitewide Pattern A (denylist by verified UA) Unknown bots still allowed
Block only sensitive sections from AI crawlers Pattern B (path-scoped blocks by UA) Mis-scoped paths block access
Avoid wildcard mistakes Pattern C (* and $) Overbroad matches reduce crawl
Handle unknown/abusive bots Pattern D (conservative robots + edge controls) Edge rules can hit search bots

Step 3 — Copy-paste robots.txt patterns (and how to avoid matching pitfalls)

Use these minimal patterns, then replace placeholders with user agents you verified in logs.

Pattern A: allow all, block a short list of known AI crawler user agents

# robots.txt

# Search bots (optional, but makes intent explicit)
User-agent: Googlebot
Disallow:

User-agent: Bingbot
Disallow:

# AI training crawlers (REPLACE with verified UAs from your logs)
User-agent: EXAMPLE-AI-CRAWLER-1
Disallow: /

User-agent: EXAMPLE-AI-CRAWLER-2
Disallow: /

# Everyone else
User-agent: *
Disallow:

Pattern B: block sensitive paths from AI crawlers only

# AI training crawlers (REPLACE with verified UAs from your logs)
User-agent: EXAMPLE-AI-CRAWLER-1
Disallow: /premium/
Disallow: /api/
Disallow: /docs/

User-agent: EXAMPLE-AI-CRAWLER-2
Disallow: /premium/
Disallow: /api/
Disallow: /docs/

### Pattern C: wildcards and end-of-string ($) — common mistake
Most “soft outages” happen when wildcard rules match more than intended.

**Common mistake (overbroad):** blocks any URL containing `pdf` anywhere.

User-agent: EXAMPLE-AI-CRAWLER-1

Disallow: /*pdf


**Corrected:** block only real `.pdf` URLs by anchoring the end.

Use `*` sparingly and test rules against real URL samples before shipping.

### Pattern D: handling unknown bots conservatively
If you’re seeing unknown or abusive crawlers, don’t “solve” it with an allowlist robots.txt.

- Keep robots.txt conservative (`User-agent: *` stays allowed).
- Enforce separately: rate limits, bot challenges, WAF rules, or token-gated access for expensive endpoints.
- Protect search bots: scope edge rules by verified IP ranges/reverse DNS where possible, and avoid blanket challenges on HTML.

## Step 4 — Test, validate, and roll out safely (no indexing surprises)
Pre-flight checks:

- `https://yourdomain.com/robots.txt` returns **200 OK**, `text/plain`, over HTTPS.
- No auth/CDN rule blocks robots.txt. In Cloudflare/WAF setups, I’ve seen “bot fight” rules block robots.txt fetches—check it explicitly.
- Assume caching: crawlers may cache robots.txt, so changes aren’t always immediate.

Log-driven verification:

- Pull recent bot requests, normalize user agents, and confirm your groups match the actual UA strings.
- Verify identity beyond UA when you can (reverse DNS / IP validation for major bots).

After deploy, monitor crawl stats and index coverage in **Google Search Console** and **Bing Webmaster Tools**, plus logs for crawl drops/spikes and rising 4xx/5xx. Version robots.txt in Git and keep a last-known-good file with a fast revert path.

## Conclusion: Practical posture for 2026
Default to a boring posture: **protect search indexing first**, then selectively discourage **verified** AI training crawlers with narrow robots.txt groups and path-scoped rules.

Start with a denylist (Pattern A) or sensitive-path blocking (Pattern B), based on what you actually saw in logs. Avoid risky allowlists unless you can tolerate accidental crawl loss.

Review bot traffic on a lightweight cadence (monthly or quarterly is usually enough) and update your AI crawler list as user agents change. Finally, remember the limit: robots.txt is guidance, not enforcement. If non-compliant or spoofed traffic is a real issue, add edge controls (rate limits/WAF/challenges) and keep them aligned with your robots intent so you don’t block Googlebot/Bingbot by mistake.

## Sources
1. [Google Search Central — Robots.txt specifications](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt)
2. [Google Search Central — Verify Googlebot](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot)
3. [Microsoft Learn — Verify Bingbot](https://learn.microsoft.com/en-us/bingwebmaster/guidelines/getting-started#verify-bingbot)
Mika Sandgrove

Article author

Mika Sandgrove

Mika Sandgrove is an SEO writer and independent SEO consultant with more than three years of experience creating and optimizing content for search. He runs his own SEO practice, helping businesses improve their organic visibility through SEO strategy, content optimization, and technical and on-page SEO services. Much of his work comes through freelance marketplaces and online client platforms, where he works with businesses across different industries and markets. Mika primarily writes about SEO, search visibility, and practical optimization strategies, and is increasingly exploring Answer Engine Optimization (AEO) and how businesses can adapt their content for AI-powered search experiences.