How to Block AI Bots in robots.txt Without Hurting SEO

Selective website crawler shield blocking AI scrapers while allowing search indexing beams

Website owners keep making the same expensive mistake when trying to stop AI scrapers: they paste a blanket Disallow: / rule under User-agent: * and watch their organic Google traffic vanish within days. Others copy outdated bot lists from forums and block live search citations while leaving training crawlers wide open.

Your robots.txt file sits at the root of your domain and acts as a traffic director for automated crawlers. Separating AI model training scrapers from search indexing bots takes ten lines of clean syntax once you know which user-agent tokens belong in each bucket.

👉 Quick Action: Build a Clean AI-Safe robots.txt in Your Browser

Pick your site preset (WordPress, E-commerce, SaaS, or News), toggle the AI crawler blocker, and download Tocares_robots.txt locally with zero server uploads.

Open Robots.txt Generator

Yes. Blocking AI training tokens like GPTBot, ClaudeBot, and Google-Extended stops foundation model scraping without affecting Googlebot Search rankings or traditional indexing. A properly segmented file isolates training crawlers while keeping Googlebot, bingbot, and AI search citation bots allowed.

Most confusion happens because site owners treat every AI bot as identical. Major AI platforms run separate crawlers for model training, live search citations, and user-triggered page fetches.

If you block search citation crawlers such as OAI-SearchBot or PerplexityBot, your pages stop appearing as clickable links inside conversational search answers. Blocking training crawlers protects your original articles from bulk dataset ingestion while keeping referral traffic intact.

How to block AI bots used for training while keeping GPTBot vs OAI-SearchBot search citations allowed
Crawler CategoryExact robots.txt TokenPurposeRecommended Action
AI Training ScraperGPTBot, ClaudeBot, CCBot, Google-ExtendedCollects web pages to train LLM foundation weights⚠️ Disallow: / if opting out of training
Traditional SearchGooglebot, Googlebot-Image, bingbotIndexes pages for Google and Bing organic rankings✅ Allow: / (never block globally)
AI Search CitationOAI-SearchBot, PerplexityBot, Claude-SearchBotFetches live pages for cited answers and referral links✅ Allow: / for visibility and clicks
User-Triggered FetcherChatGPT-User, Claude-User, Perplexity-UserReads one URL when a user pastes it into a chat💡 Optional (disallow only on paywalled areas)
Third-Party SEO AuditAhrefsBot, SemrushBot, MJ12bot, DotBotCrawls backlinks and site metrics for external tools🔒 Disallow if heavy crawling slows shared hosting

Note one technical quirk about Google-Extended: Google does not send a separate HTTP user-agent string for it. Standard Googlebot and GoogleOther crawlers read the Google-Extended rule in your file to opt your domain out of Gemini model training without removing your site from Google Search.

5 robots.txt Mistakes That Break Rankings or Waste Crawl Budget

Most organic traffic drops after a robots.txt edit come from wildcard blocks, blocking CSS/JS folders, using Disallow instead of noindex, or conflicting path lengths under RFC 9309. Fixing these five technical traps restores clean crawling and stops Google Search Console indexing warnings.

1. Using Wildcard Disallow to Stop Scrapers

A single line reading User-agent: * followed by Disallow: / tells every compliant crawler, including Googlebot and Bingbot, to stop crawling your entire domain. Always place specific bot blocks under their own User-agent header and keep User-agent: * open for normal public pages.

2. Using robots.txt Instead of noindex to Hide Pages

Why does Google Search Console show “Indexed, though blocked by robots.txt”? robots.txt blocks crawling, not indexing. When external or internal links point to a disallowed URL, Google can index the bare link without reading the page, so it never sees your <meta name="robots" content="noindex"> tag.

To remove thank-you pages, tag archives, or staging links from Google Search, remove the Disallow line for those URLs first. Serve a noindex meta tag or X-Robots-Tag: noindex header, wait for Googlebot to recrawl, and let the URL drop out cleanly.

Diagram comparing blocked page with noindex tag trapped in Google index versus allowing crawl so Googlebot reads noindex cleanly

3. Blocking WordPress Theme CSS and JavaScript

Older WordPress tutorials often tell users to block /wp-content/ or /wp-includes/ completely. When Googlebot cannot fetch your stylesheets or scripts, it fails to render mobile layouts properly and may downgrade page experience signals.

Keep /wp-admin/ disallowed (or allow /wp-admin/admin-ajax.php if front-end widgets rely on it), block /xmlrpc.php, and leave /wp-content/uploads/ crawlable if you want your blog images ranking in Google Images.

4. Ignoring RFC 9309 Longest-Match Precedence

Under the official robots.txt standard (RFC 9309), crawlers do not read rules strictly top to bottom. When an Allow rule and a Disallow rule match the same URL, the directive with the longest path string wins, regardless of line order.

None

✅ Pre-Publish robots.txt Audit Checklist

  • ✅ Root User-agent: * allows public HTML, CSS, JS, and media folders.
  • ✅ AI training bots (GPTBot, ClaudeBot, Google-Extended, CCBot) live in separate blocks.
  • ✅ Live search citation bots (OAI-SearchBot, PerplexityBot) remain allowed if you want AI referrals.
  • ✅ At least one absolute Sitemap: https://yourdomain.com/sitemap.xml line sits at the bottom.
  • ✅ File is saved as plain UTF-8 text named exactly robots.txt (all lowercase) at your domain root.

How Should You Build and Deploy a Clean robots.txt File?

You can write the file manually in a plain text editor, edit it inside a WordPress SEO plugin, or build it directly in your browser using the Tocares Robots.txt Generator. Tocares processes every rule client-side in native JavaScript and exports Tocares_robots.txt via a local browser Blob, keeping your private admin paths off third-party servers.

Method 1: Manual Text Editor + Root Upload (Full Control)

If you run a static HTML site, Next.js export, or custom VPS, open a plain code editor (avoid Microsoft Word or Rich Text editors, which insert invisible smart quotes). Paste the balanced template below, swap yourdomain.com for your live domain, save as robots.txt, and upload it to public_html/ or your /public/ folder.

None
  1. Pick a Business Type Preset: Choose WordPress Blog, E-commerce Store, SaaS / App, or News / Media to auto-fill standard disallow paths like /cart/, /checkout/, or /wp-admin/.
  2. Verify Default Policy and Sitemap URL: Keep Default Policy (*) on Allow All, leave Crawl Delay blank unless shared hosting is overloaded (Googlebot ignores Crawl-delay), and paste your full XML sitemap URL.
  3. Configure Specific Bots and Advanced Blocking: Leave Google, Google Image, and Bing / MSN on Default or Allowed. Tick Block AI Crawlers (GPT, Claude, CCBot) to generate rules for GPTBot, ChatGPT-User, Google-Extended, CCBot, and anthropic-ai (and optionally tick Block SEO Tools for Ahrefs/Semrush).
  4. Fine-Tune in the Editable Output Box: Click Generate Robots.txt. Because the output box is editable right on the page, add User-agent: ClaudeBot if needed or remove ChatGPT-User if you want live user-prompted fetches enabled, then click Copy or Download.
Screenshot of Tocares Robots.txt Generator showing WordPress Blog preset, AI crawler toggle enabled, and editable generated robots.txt output

Before uploading, rename the downloaded Tocares_robots.txt file to robots.txt and visit https://yourdomain.com/robots.txt in an incognito tab to confirm it returns HTTP 200 OK as plain text.

Cloudflare, Yoast, and Rank Math Conflicts to Check

Edge CDN rules in Cloudflare run before WordPress ever responds, so an aggressive Cloudflare AI Crawl Control toggle can override your origin robots.txt rules. Always audit both your CDN dashboard and your SEO plugin virtual file editor before assuming crawlers can reach your pages.

LayerHow It Controls CrawlersCommon Conflict Risk
Physical Root File (/robots.txt)Served directly by Apache, Nginx, or static host⚠️ Blocks WordPress plugins (Rank Math/Yoast) from serving their virtual robots.txt
Rank Math / Yoast Virtual EditorDynamically generated by WordPress when no physical file exists⚠️ Editing plugin rules has zero effect if an old physical robots.txt sits in public_html
Cloudflare AI Crawl Control / WAFIntercepts or rewrites bot requests at the CDN edge🔒 Managed bot toggles can block search fetchers even when your WordPress file allows them

If your WordPress edits are not showing up at yourdomain.com/robots.txt, connect via FTP or cPanel File Manager and check if an old physical robots.txt file exists in the root directory. Keep one source of truth instead of splitting rules across three places.

What to Do Next: Complete Your Technical SEO Hygiene

Once your crawler rules are live, finish the rest of your indexing and redirect setup across these companion Web Developer Utilities and SEO and Schema Tools:

Troubleshooting FAQs

Does blocking GPTBot or Google-Extended hurt my Google Search rankings?

No. Google confirms that Google-Extended only governs Gemini training and non-Search generative grounding, while OpenAI confirms GPTBot is separate from search indexing. Keeping Googlebot and bingbot allowed preserves your traditional organic search visibility.

Should I use Crawl-delay: 10 in my robots.txt?

Googlebot ignores the Crawl-delay directive completely; adjust Google crawl rate only if needed inside Search Console or server response headers. Bingbot and Yandex still honor Crawl-delay, so leave it blank unless automated bots are genuinely overloading your server CPU.

Why do I still see AI scraper hits in my server logs after updating robots.txt?

robots.txt only guides compliant crawlers that check the file before requesting pages. Rogue scrapers ignore it or disguise themselves as regular Chrome browsers, so persistent bandwidth abuse requires Cloudflare WAF rules or server-level rate limiting.

Can I block specific folders like /members/ from AI bots while allowing my blog?

Yes. Under User-agent: GPTBot or User-agent: ClaudeBot, list specific paths such as Disallow: /members/ instead of Disallow: /, and keep your public /blog/ path open if you still want visibility there.