Robots.txt Guide: 8 Proven Steps to Control Crawlers in 2026
Your robots.txt file was probably last edited for Googlebot. It almost certainly doesn't account for GPTBot, OAI-SearchBot, ClaudeBot, Claude-SearchBot, PerplexityBot, or the dozens of others that have appeared since 2023. That gap has a measurable cost. AI search visits grew 42.8% year over year between Q1 2025 and Q1 2026, climbing from 15.6 billion to 27.4 billion. Meanwhile Cloudflare's bot analytics show AI crawlers reaching 39% of the top million websites every month, and only 3% of those sites making a deliberate decision about it. Here's the eight-step audit I run.
Table of Contents
- What robots.txt Actually Controls in 2026
- Step 1: Read Your Current File Before Editing
- Step 2: Separate Training Bots From Retrieval Bots
- Step 3: Decide Your AI Policy on Purpose
- Step 4: Understand the 23% Traffic Trap
- Step 5: Never Block CSS or JavaScript
- Step 6: Prune Rule Bloat
- Step 7: Enforce at the Edge, Not Just in the File
- Step 8: Test and Monitor Monthly
- Robots.txt Mistakes That Cost Visibility
- Final Thoughts
What robots.txt Actually Controls in 2026
Robots.txt is a plain-text file at your domain root that tells automated crawlers which paths they may request. It is a request, not a wall. Well-behaved bots honour it; rogue scrapers ignore it entirely.
That distinction matters more now than it used to, because the crawler population has fragmented. Search engines, AI training crawlers, AI retrieval crawlers, and user-triggered agents all behave differently, and they all read the same file.
There's also a structural problem in the data: 707 sites in one 2026 analysis had at least 100 Disallow rules, 13 had at least 1,000, 240 named at least 50 user agents, and 110 named at least 100. That's not a policy. That's accumulated sediment from a decade of quick fixes. My technical SEO audit checklist covers where this sits in a broader audit.
Step 1: Read Your Current File Before Editing
Open /robots.txt and read every line. Most sites have inherited rules nobody understands, often added by a plugin or a former agency.
Look for three things: a Disallow rule that accidentally blocks a folder you need indexed, a Sitemap directive pointing at an old URL, and user-agent blocks for crawlers you didn't know existed.
Then check whether the file even loads. A robots.txt returning a 5xx error tells crawlers to back off entirely, and Google may stop crawling the site until it resolves.
Step 2: Separate Training Bots From Retrieval Bots
This is the distinction that decides everything else. Each major AI company runs separate bots for different jobs, and blocking one does not block the others.
Training crawlers — GPTBot, ClaudeBot, Google-Extended — collect content that may be used to train models. Retrieval crawlers — OAI-SearchBot, Claude-SearchBot, PerplexityBot — fetch pages live to answer a user's question right now. User-triggered agents — like Perplexity-User — act on a specific person's request and may not consider themselves bound by robots.txt at all.
GPTBot alone grew from 5% to 30% of AI crawler share between May 2024 and May 2025, and training crawlers now account for 67.5% of AI-driven traffic by volume. If you block one without knowing which one, you're making a policy decision by accident.
Step 3: Decide Your AI Policy on Purpose
There are three coherent positions. Pick one and write it down.
Open — allow everything, prioritise citation share. Selective — allow retrieval bots, block training bots. Closed — block all AI crawlers and rely on traditional search.
The selective strategy is the most commonly recommended, and it's defensible. But it's not free. The data below explains why. Whatever you choose, the worst outcome is the current default: an aggressive Cloudflare or Sucuri template silently blocking half the list. Most websites built or last audited before 2023 block AI crawlers by default without anyone deciding to.
Step 4: Understand the 23% Traffic Trap
Here's the finding that should slow you down before you paste a block rule. December 2025 research from Rutgers and Wharton found publishers blocking AI crawlers experienced a 23.1% total traffic decline without reliably reducing AI citation rates.
Read that again. Blocking didn't protect them from being cited, and it cost them nearly a quarter of their traffic. The likely mechanism is that training inclusion builds long-term model familiarity, so blocking training crawlers removes you from a system that was quietly recommending you.
The blocking rates are also wildly inconsistent across the web. An Ahrefs sample of 24,550 German-language hosts found 2.27% block GPTBot — but 61% of large publishers do. Among 98 B2B software vendors, none blocked AI search crawlers site-wide, and only 2 of 98 disallowed even one training crawler.
My generative engine optimization guide covers what to do instead of blocking.
Step 5: Never Block CSS or JavaScript
This is the one rule with no exceptions. If robots.txt blocks your CSS or JavaScript files, Google can't render your page properly, and the ranking damage is severe and hard to diagnose.
Check for a broad Disallow: /wp-content/ or Disallow: /assets/ rule — both are common in copied templates and both break rendering. My JavaScript SEO guide covers why the render step matters so much.
Step 6: Prune Rule Bloat
Long robots.txt files are a liability, not a strategy. Every rule is a chance to block something you needed, and no crawler rewards you for complexity.
Aim for under 20 lines. Keep the Sitemap directive, block the paths that genuinely waste crawl budget — internal search results, faceted parameter combinations with no demand, admin and checkout paths — and allow everything else.
Then move the fine-grained control to canonical tags and page-level directives, where it belongs. My canonical tags guide and my log file analysis SEO guide cover the alternative controls.
Step 7: Enforce at the Edge, Not Just in the File
Robots.txt is advisory. If you actually need to stop a crawler, the file won't do it.
Cloudflare published evidence in August 2025 of Perplexity using undeclared crawlers that circumvent directives, and Perplexity has stated that Perplexity-User is an agent rather than a bot, so it isn't required to honour robots.txt. That's not an edge case — it's the direction the ecosystem is moving.
Real enforcement means WAF rules, CDN bot management, and rate limiting at the edge layer. Use robots.txt to express policy and the edge to enforce it.
Step 8: Test and Monitor Monthly
Once a month, fetch your robots.txt as different user agents and confirm the response matches your policy. Then check your server logs for which AI crawlers are actually arriving — and which are getting 403s.
Two signals worth watching: a sudden drop in requests from a crawler you meant to allow, and a spike in 403s from a crawler you've never heard of. Both mean the file and reality have diverged.
My Google Search Console tutorial covers the robots.txt report and the crawl stats you'll pair this with.
Robots.txt Mistakes That Cost Visibility
- Blocking CSS or JS — breaks rendering and hides the cause.
- Blocking all AI crawlers reflexively — 23.1% traffic decline, no citation benefit.
- Confusing training bots with retrieval bots — the wrong block removes you from answers.
- Hundreds of Disallow rules — guaranteed to block something you needed.
- Assuming the file enforces anything — rogue crawlers ignore it.
If a bad rule already deindexed pages, my Google penalty recovery guide covers the diagnostic path.
Final Thoughts
This robots.txt guide comes down to one habit: make the AI decision on purpose instead of inheriting it. Read the file, separate training from retrieval, choose a policy, prune the bloat, and enforce at the edge.
If you want the ranking foundation underneath, read my guide on ranking higher on Google. Then open your robots.txt and count the lines. If it's over 20, you have work to do.