Robots.txt Guide: How to Control Crawlers and Manage AI Bots in 2026

A robots.txt file sits at your domain root and tells crawlers which parts of your site they may access. In 2026 its biggest job is AI bot management – and the key insight is that AI providers run separate training and search crawlers. Block GPTBot (OpenAI training) to opt out of model training, but keep OAI-SearchBot (OpenAI search) allowed or you disappear from ChatGPT’s cited answers. Two crucial cautions: robots.txt controls crawling, not indexing (a blocked page can still be indexed – use noindex to hide it), and it’s a voluntary request, not a lock. Never block your CSS or JavaScript.

Your robots.txt is probably the most powerful file on your website relative to its size – a few lines of plain text that can quietly hide your entire site from Google, or delete you from ChatGPT’s answers, without a single error message. Most sites are running one copied from a template years ago, and it’s making decisions the owner never consciously made.

This is the full expansion of Step 2 of the technical SEO strategies guide on GrowWithSakib. It pairs directly with the XML sitemap guide on GrowWithSakib, since the two files work together to steer crawlers.

What Robots.txt Is – and the One Thing It Doesn’t Do

A robots.txt file lives at yourdomain.com/robots.txt and gives instructions to web crawlers about which URLs they may request. It’s the first thing most bots check before crawling. The syntax is simple – but there’s one misunderstanding that causes more damage than any other.

This is the single most important thing to understand. Disallow stops a bot from crawling a page – it does not stop that page being indexed. If another site links to a URL you’ve blocked, Google can still index it (often showing “No information is available for this page”), because the block prevents crawling, not knowledge of the URL’s existence.

So if your goal is to keep a page out of Google’s results, robots.txt is the wrong tool. Use a noindex meta tag instead – and, crucially, don’t also block the page in robots.txt, or Google can’t crawl it to see the noindex. Block to save crawl budget; noindex to control the index. They are different jobs.

The Syntax: Four Directives You Need

Robots.txt is built from a handful of directives. Here they are, in plain English:

DirectiveWhat It DoesExample
User-agentNames which bot the rules below apply toUser-agent: Googlebot
DisallowBlocks a path from being crawledDisallow: /admin/
AllowPermits a path (overrides a broader Disallow)Allow: /admin/public/
SitemapPoints crawlers to your XML sitemapSitemap: https://site.com/sitemap.xml

A few rules that trip people up: the file is case-sensitive (Disallow, not disallow; GPTBot, not gptbot), User-agent: * means “all bots not named elsewhere,” and Disallow: with nothing after it means “allow everything.” The most dangerous line in existence is Disallow: / – a single slash that blocks your entire site.

User-agent: *

Disallow: /wp-admin/

Disallow: /cart/

Disallow: /checkout/

Disallow: /*?s=

Allow: /wp-admin/admin-ajax.php

Sitemap: https://yourdomain.com/sitemap_index.xml

This blocks admin, cart, checkout and internal search, allows the one admin file WordPress needs, and points to your sitemap. For most sites, that’s 90% of what you need.

The Mistake That Hides You From Google: Blocking CSS and JavaScript

Years ago, people blocked /wp-includes/ and theme folders to “save crawl budget.” That advice is now actively harmful. Google renders your pages like a browser to understand them, and to render, it needs your CSS and JavaScript. Block those resources and Google sees a broken, contentless page – which it then ranks accordingly.

Do not block /wp-content/, /wp-includes/, .css or .js files. Google’s own guidance is explicit that blocking CSS and JS hurts how it renders and ranks your pages – and since most AI crawlers can’t render JavaScript at all, a page that depends on blocked resources is doubly invisible. If you inherited a robots.txt that blocks these, removing those lines can produce an immediate improvement.

The 2026 Question: Managing AI Bots

Here’s what’s genuinely new, and where most robots.txt files are silently out of date. It is no longer just search engines crawling you – AI companies do too. And the critical insight almost every old guide misses:

Every major AI provider now runs at least two separate crawlers, each with its own user-agent and its own robots.txt rule:

– A training crawler (GPTBot, Google-Extended, ClaudeBot) collects pages to train the model. No attribution, no link back.

– A search crawler (OAI-SearchBot, PerplexityBot, Claude-SearchBot) indexes pages so the AI can cite you in answers, with a link back.

Blocking one does not block the other. This is the entire basis of a smart 2026 policy: opt out of training while staying eligible for AI-search citations. Block the training bot, keep the search bot.

The Five Bots You Must Know (and What to Do With Each)

The brief for any 2026 robots.txt comes down to five user-agents. Here’s the decision for each, with the reasoning:

BotRun ByPurposeRecommendation
GooglebotGoogleClassic Google Search indexingALWAYS ALLOW. Blocking removes you from Google entirely
Google-ExtendedGoogleGemini / Vertex AI trainingYour call. Google confirmed blocking it has ZERO effect on Search rankings
GPTBotOpenAIChatGPT model trainingYour call. Block to opt out of training; no effect on ChatGPT search
OAI-SearchBotOpenAIChatGPT search index (citations)ALLOW if you want to appear in ChatGPT’s answers
PerplexityBotPerplexityPerplexity search index (citations)ALLOW. Perplexity doesn’t train on you; this earns citations

The most common fear: “if I block Google-Extended, will my Google rankings drop?” No. Google has explicitly confirmed that Google-Extended is entirely separate from Googlebot, and blocking it has zero effect on Google Search rankings. It only controls whether your content trains Gemini and Vertex AI. Googlebot and Google-Extended are different tokens – never confuse them, and never block Googlebot.

A client couldn’t understand why competitors kept appearing in ChatGPT’s answers and they never did. Their content was strong, their rankings in Google were fine. They assumed it was a content problem.

It wasn’t. Their robots.txt had been copied from a privacy-focused template back in 2023, in the first wave of ‘block the AI bots’ panic. Buried in it was ‘User-agent: OAI-SearchBot / Disallow: /’ – they had explicitly blocked the exact crawler that makes a site eligible for ChatGPT citations. They’d meant to opt out of training; they’d accidentally opted out of visibility.

We removed the block on the search bots, kept the training block they actually wanted, and within weeks they started surfacing in ChatGPT answers. One inherited line had been quietly deleting them from the fastest-growing discovery channel there is.

The Copy-Paste 2026 Config: Block Training, Keep Citations

This is the most common posture for a business that wants AI visibility but not to feed model training. Adjust the training decisions to your own policy:

# === Standard search engines: always allow ===
User-agent: Googlebot
Allow: /

# === AI SEARCH bots: ALLOW (this earns citations) ===
User-agent: OAI-SearchBot
Allow: / User-agent: PerplexityBot
Allow: / User-agent: Claude-SearchBot
Allow: /

# === AI TRAINING bots: block to opt out of training ===
User-agent: GPTBot
Disallow: / User-agent: Google-Extended
Disallow: / User-agent: ClaudeBot
Disallow: / User-agent: CCBot
Disallow: /

# === Everyone else: allow, but protect private paths ===
User-agent: *
Disallow: /wp-admin/
Disallow: /checkout/
Disallow: /cart/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://yourdomain.com/sitemap_index.xml

If your file has no global Disallow: / for User-agent: *, those Allow: / lines are technically redundant – the bots were already allowed by default. Keep them anyway. They document your intent, and they protect you if someone later adds a blanket block. In a file you touch once a year, clarity beats minimalism.

The Honest Caveat: Robots.txt Is a Request, Not a Lock

This matters, and most guides gloss over it. Robots.txt is a voluntary standard (formalised as RFC 9309). It works because well-behaved bots choose to honour it – Googlebot, GPTBot, ClaudeBot and PerplexityBot document their user-agents and comply, and you can verify that in your server logs. But:

  • Some bots ignore it entirely – Bytespider (ByteDance) and, per Cloudflare’s August 2025 findings, some of Perplexity’s stealth crawlers have been documented crawling sites that disallowed them.
  • It doesn’t hide sensitive data – a disallowed path is publicly readable in your robots.txt, so never use it to “hide” private URLs. It’s a signpost, not a safe.
  • Real enforcement is at the server – to actually block a non-compliant bot, use server rules, a WAF, or a service like Cloudflare’s bot management, which blocks by behaviour rather than politely asking.
Recommended Hosting Partner

Could Better Hosting Improve Your Website Experience?

A dependable hosting setup helps create the performance and stability your website needs to grow.

  • WordPress Hosting
  • SSL Included
  • 24/7 Support
  • Reliable Speed
Explore Hostinger
Affiliate disclosure: We may earn a commission at no extra cost to you.

How to Test Your Robots.txt

Never edit robots.txt on a live site without testing – the downside is hiding your whole site. Two checks:

  1. Use the robots.txt report in Google Search Console (Settings, then robots.txt). It shows the file Google last fetched, flags syntax errors, and lets you request a re-fetch after edits.
  2. Use the URL Inspection tool to confirm a specific important page is crawlable (‘URL is available to Google’). Do this for a key page after any robots.txt change.
  3. Check your server logs to verify which bots are actually visiting and being allowed or blocked – the only way to confirm real behaviour rather than intended behaviour.

For the wider set of checks these tools support, see how to use Google Search Console on GrowWithSakib.

A client launched a beautiful new site on a Monday. By Friday, not a single page had been indexed, and panic was setting in. They were sure it was a Google penalty.

It was one line. The developer had built the site on a staging server with ‘User-agent: * / Disallow: /’ to keep it out of Google during development – standard practice. But at launch, nobody removed it. The live site was shipping with a robots.txt that told every crawler to stay out entirely.

We deleted the single Disallow line and submitted the sitemap. Indexing began within days. It’s the most common launch disaster in technical SEO, and the reason ‘check robots.txt’ is the very first item on our go-live checklist. One slash had made a whole website invisible.

Keeping It Current

  • Audit quarterly – the AI bot landscape moves fast. OAI-SearchBot arrived in 2024, Claude-SearchBot in 2025; tokens like anthropic-ai and Claude-Web are now deprecated. A stale robots.txt makes stale decisions.
  • Re-check after every CMS or plugin change – SEO plugins and platform updates can rewrite robots.txt without telling you.
  • Decide on purpose – your AI-bot policy should be a deliberate brand decision, written and commented in the file, not whatever your CMS shipped with.

Remember: allowing is not appearing – letting the search bots in is necessary but not sufficient. Being crawlable doesn’t guarantee a citation; for that, see how to get cited by ChatGPT and Perplexity on GrowWithSakib and the wider generative engine optimisation guide on GrowWithSakib.

Common Robots.txt Mistakes

MistakeWhy It HurtsDo This Instead
Leaving Disallow: / after launchHides your entire site from GoogleRemove it the moment you go live
Using robots.txt to hide pagesIt blocks crawling, not indexingUse a noindex meta tag instead
Blocking CSS and JSGoogle can’t render or rank the pageNever block rendering resources
Blocking OAI-SearchBot by accidentDeletes you from ChatGPT citationsAllow search bots; block only training bots
Blocking Googlebot to ‘block AI’Removes you from Google Search entirelyBlock Google-Extended instead; never Googlebot
Assuming it blocks all botsBytespider and others ignore itUse a WAF/server rules for real enforcement
Never testing after editsOne typo can hide everythingTest in Search Console before and after
Copying a 2023 templateIt likely blocks the AI search botsUse a current, commented config

Not Sure What Your Robots.txt Is Actually Doing?

Most businesses have never read their own robots.txt – and a worrying number are quietly blocking the AI search bots that would cite them, or carrying a leftover line from a template that limits how Google sees them. It’s a few lines of text with an outsized effect on whether you’re found at all, in both search and AI.

At GrowWithSakib, we audit and rebuild robots.txt files properly: making sure Google and the AI search bots can reach what they should, training bots are handled to your policy, nothing critical is blocked, and every decision is deliberate and documented.

Frequently Asked Questions

What is a robots.txt file and what does it do?

A robots.txt file is a plain-text file at your domain root (yourdomain.com/robots.txt) that tells web crawlers which parts of your site they may access. It uses simple directives – User-agent to name a bot, Disallow to block a path, Allow to permit one, and Sitemap to point to your XML sitemap. Its crucial limitation is that it controls crawling, not indexing: a blocked page can still be indexed if other sites link to it. It’s also voluntary, so only well-behaved bots obey it.

Does robots.txt stop a page being indexed?

No, and this is the most common misconception. Robots.txt stops compliant bots from crawling a page, but it does not stop that page being indexed. If another site links to a URL you’ve disallowed, Google can still index it, often showing ‘No information is available for this page’ because it couldn’t crawl the content. To keep a page out of Google’s index, use a noindex meta tag instead – and don’t also block it in robots.txt, or Google can’t crawl the page to see the noindex directive.

Should I block AI bots in robots.txt?

It depends which ones, and this is the key 2026 decision. AI providers run separate training and search crawlers. Blocking training bots like GPTBot, Google-Extended and ClaudeBot opts your content out of model training – a legitimate choice. But blocking search bots like OAI-SearchBot and PerplexityBot removes you from AI-generated answers and citations, which is fast becoming a major discovery channel. For most businesses that want to be found, the smart posture is to block training bots if you wish, but keep the search bots allowed.

Does blocking Google-Extended hurt my Google rankings?

No. Google has explicitly confirmed that Google-Extended is entirely separate from Googlebot, and blocking it has zero effect on your Google Search rankings or how Google crawls and indexes your site for search. Google-Extended only controls whether your content is used to train Google’s generative AI models, Gemini and Vertex AI. You can safely block Google-Extended to opt out of AI training while remaining fully visible in Google Search. Just never confuse it with Googlebot, which you should never block.

What is the difference between GPTBot and OAI-SearchBot?

They’re both OpenAI’s, but they do opposite jobs. GPTBot is the training crawler – it collects content that may be used to train OpenAI’s foundation models, with no attribution or link back. OAI-SearchBot is the search crawler – it indexes pages so ChatGPT can cite them in search answers, with a link to your site. Blocking GPTBot opts you out of training but has no effect on ChatGPT search; blocking OAI-SearchBot removes you from ChatGPT’s cited answers. They’re separate user-agents needing separate rules, which is why blocking ‘OpenAI’ as one thing is a mistake.

Why shouldn’t I block CSS and JavaScript in robots.txt?

Because Google renders your pages like a browser to understand them, and rendering requires your CSS and JavaScript. If you block those resources, Google sees a broken, contentless version of your page and ranks it accordingly. Older SEO advice to block folders like /wp-includes/ to save crawl budget is now actively harmful. The problem is worse for AI search, since most AI crawlers can’t execute JavaScript at all – a page depending on blocked resources is doubly invisible. Never disallow your CSS, JS, or the folders containing them.

How do I test my robots.txt file?

Use the robots.txt report in Google Search Console, under Settings, which shows the file Google last fetched, flags syntax errors, and lets you request a re-fetch after editing. Then use the URL Inspection tool to confirm a specific important page returns ‘URL is available to Google’. Finally, check your server logs to verify which bots are actually being allowed or blocked in practice. Always test before and after any edit to a live site, because a single wrong line can hide your entire site from search.

How often should I update my robots.txt?

Audit it at least quarterly, because the AI crawler landscape changes fast – OAI-SearchBot appeared in 2024, Claude-SearchBot in 2025, and older tokens like anthropic-ai and Claude-Web are now deprecated. Also re-check it after any CMS upgrade or SEO plugin change, since those can silently rewrite the file. Most importantly, treat your AI-bot policy as a deliberate decision to revisit, not a set-and-forget file: the defaults you inherited years ago almost certainly don’t reflect the choices you’d make today.

Key Takeaways

  • Robots.txt is a plain-text file at your domain root that tells crawlers which paths they may access – powerful enough that one wrong line can hide your whole site.
  • It controls crawling, NOT indexing. A blocked page can still be indexed if linked elsewhere – use a noindex tag, not Disallow, to keep a page out of Google.
  • The 2026 key insight: AI providers run separate training and search bots. Block one and the other is unaffected – they need separate rules.
  • Block training bots (GPTBot, Google-Extended, ClaudeBot) to opt out of model training; keep search bots (OAI-SearchBot, PerplexityBot) allowed to stay citable in AI answers.
  • Blocking Google-Extended has ZERO effect on Google Search rankings – Google confirmed it. But never block Googlebot, which removes you from Google entirely.
  • Never block CSS or JavaScript. Google needs them to render your pages, and most AI crawlers can’t run JS at all – blocked resources make you doubly invisible.
  • Robots.txt is voluntary (RFC 9309). Bots like Bytespider ignore it; real enforcement needs server rules, a WAF, or a service like Cloudflare.
  • Test every change in Google Search Console before and after. The most common disaster is a leftover ‘Disallow: /’ from staging hiding a new site at launch.