| Robots.txt is a plain text file placed at the root of your website that controls which pages search engine crawlers — and AI bots — can access. It does not control indexing: a page blocked in robots.txt can still appear in Google Search results if other sites link to it. The Robots Exclusion Protocol has existed since 1994 and was formally published as an official internet standard under RFC 9309 in September 2022. In 2026, it carries a second function it did not have three years ago: every major AI platform — ChatGPT, Perplexity, Google Gemini, Apple Intelligence — runs its own dedicated crawler that checks your robots.txt before deciding whether to access your content. This guide is written by Omar Elshair, founder of SEO Detective. It covers the complete robots.txt system: how the Disallow, Allow, Crawl-delay, and Sitemap directives work, how to manage crawl budget on large sites, how to configure AI crawler rules for GPTBot, Google-Extended, PerplexityBot, and Claude-Web without affecting your Google Search rankings, the most damaging robots.txt mistakes still common in 2026, and how to validate your file using third-party tools — since Google removed the interactive robots.txt tester from Search Console on December 12, 2023. If you have already read the Technical SEO for Beginners guide on this platform, note that robots.txt is the first element in the crawl sequence — a single misconfigured line blocks Googlebot before every other technical optimization can take effect. |
Why Robots.txt Still Matters — and Why It Matters More Than Ever in 2026
You have spent months building out your website. Pages are live. Content is published. And then one day you check Google Search Console and notice that a whole section of the site is not indexed. The culprit, more often than you would guess, is a single misplaced line in robots.txt.
Robots.txt is the Robots Exclusion Protocol (REP) — a standard that has existed since 1994 and was published as a proposed internet standard under RFC 9309 in September 2022. Despite its age, it is more relevant today than ever. Search engines are crawling more aggressively than before, and websites with thousands of pages face real server load and crawl budget problems without it.
In 2026, a new layer of urgency has been added. AI platforms — ChatGPT, Perplexity, Google’s Gemini, and Apple’s AI features — all use their own dedicated crawlers. Every one of those crawlers checks your robots.txt file before deciding whether to access your content. According to data published by Cloudflare in 2025, GPTBot is one of the most frequently referenced user-agents in robots.txt files globally, and AI bot rules have become standard practice among the world’s most-trafficked websites.
Block the wrong crawlers and your content disappears from AI-generated answers. Block nothing and your articles may end up training AI models without your consent. Getting robots.txt right in 2026 means managing both goals simultaneously.
What Robots.txt Actually Does — and What It Cannot Do
This is the single most misunderstood point in all of technical SEO: robots.txt controls crawling, not indexing. These are two completely different things.
Crawling is when a bot visits your page to read its content. Indexing is when a search engine stores that content in its database so it can appear in search results. You can block crawling and still end up indexed. As Google’s own documentation confirms, if other websites link to a page you have blocked in robots.txt, Google may still index that URL — it just cannot read the content, so it will index the URL based on anchor text and other signals instead.
If you need a page to stay out of Google’s index entirely, use the noindex meta tag on that page, not robots.txt. If you use robots.txt to block the page, the crawler cannot even reach the noindex tag — which means the directive goes unread. The result is a page that is blocked from crawling but potentially still indexed.
A simple decision framework:
- Use robots.txt when you want to save crawl budget and keep bots away from low-value URLs (admin pages, internal search results, parameter-driven duplicates).
- Use noindex when the page can be crawled but must not appear in search results.
- Use password protection when the content is genuinely confidential and you do not want any bot to access it at all.
How Robots.txt Is Structured: The Directives You Need to Know
A robots.txt file uses a handful of simple directives. Each block of rules starts with a User-agent line that names the crawler, followed by one or more Disallow or Allow lines that define what it can and cannot access.
User-agent — Identify the Target Crawler
The User-agent directive specifies which bot the rules below apply to. Use an asterisk (*) to target all crawlers at once. Use a specific name — such as Googlebot, Bingbot, or GPTBot — to write rules for a single crawler only.
| User-agent: * Disallow: /keep-out/ |
| User-agent: Googlebot Disallow: /private/ |
Disallow — Block Specific Paths
The Disallow directive tells a crawler to avoid a specific path. An empty Disallow line means the crawler is allowed everywhere — which is the default behavior anyway.
| # Block the entire site from all bots (not recommended unless intentional) User-agent: * Disallow: / # Block a specific folder User-agent: * Disallow: /admin/ # Block URL parameter patterns User-agent: * Disallow: /*?* |
Allow — Grant Exceptions Inside Blocked Areas
The Allow directive overrides a Disallow rule for a specific path. This is useful when you block a directory but need to keep one page inside it accessible.
| User-agent: * Disallow: /accounts/ Allow: /accounts/signup |
Because robots.txt defaults to allowing everything, you generally do not need to combine Allow and Disallow unless you are managing a complex structure. Keep it simple when possible — complexity introduces syntax errors that can have serious consequences.
Crawl-delay — Manage Server Load
The Crawl-delay directive asks bots to pause between requests, reducing server load during heavy crawl periods. Modern crawlers are sophisticated enough to detect server strain on their own. Crawl-delay is more useful for smaller hosting environments or when less well-behaved crawlers are hitting the site hard. Note: Google does not officially support Crawl-delay. To reduce Google’s crawl rate specifically, adjust it inside Google Search Console under Settings — Crawl rate.
| User-agent: * Crawl-delay: 5 |
Sitemap — Link Your XML Sitemap
Adding a Sitemap reference at the bottom of robots.txt is an accepted standard. Google and Bing both recommend submitting sitemaps directly via Search Console and Bing Webmaster Tools, but including the reference in robots.txt adds a useful discovery signal at no cost. The URL must be fully qualified (including https://) and must match the exact protocol and domain of your site.
| Sitemap: https://www.your-site.com/sitemap.xml |
Comments — Document Your Rules
Comments are added with a pound sign (#) and are ignored by crawlers. Add the date each time you make changes to save hours of debugging if an old backup is ever accidentally restored.
| # robots.txt for www.example-site.com # Last updated: March 2026 User-agent: * Disallow: /admin/ Disallow: /internal-search/ Sitemap: https://www.example-site.com/sitemap.xml |
Crawl Budget: Why It Matters and Which Pages to Block
Google allocates a crawl budget to each website — a finite number of pages it will crawl within a given period. For e-commerce stores with tens of thousands of product variants, or for news sites with large archives, crawl budget management can directly affect how quickly new content gets indexed.
When Googlebot wastes crawl requests on session IDs, filter parameters, and duplicate checkout URLs, it has fewer requests left for your new blog posts or updated product pages. Targeted robots.txt rules that block low-value parameter-driven URLs are one of the most direct ways to improve crawl efficiency on large sites.
Pages You Should Almost Always Block
- Admin and login pages (/wp-admin/, /dashboard/, /login/)
- Internal site search results (/search?q=…)
- Faceted navigation and filter parameters (unless part of your SEO strategy)
- Add-to-cart, checkout, and account management URLs
- Staging or development subfolders accidentally left crawlable
- Printer-friendly page variants and duplicate content paths
Pages You Must Never Block
- Core pages (homepage, main category pages, top blog posts)
- CSS and JavaScript files Google needs to render your pages — blocking these prevents Google from understanding your layout and can harm rankings
- XML sitemaps and sitemap index files
- Canonical versions of any page you want indexed
A practical example: an e-commerce site selling electronics might have 500 core product pages and 20,000 parameter-driven filter URLs. Blocking the filter URLs with Disallow: /*?* keeps Googlebot focused on the 500 pages that actually generate revenue.
Robots.txt and AI Crawlers in 2026: The New Decision You Must Make
Here is the situation that did not exist two years ago: your robots.txt now controls whether your content appears in ChatGPT, Perplexity, Google Gemini, and every other AI platform that generates answers from the web. AI crawlers fall into two distinct categories.
Training Crawlers — They Collect Your Content to Build AI Models
These bots harvest public web pages in bulk to improve large language models. Allowing them means your content becomes part of a training dataset. They do not necessarily send you traffic in return.
- GPTBot (OpenAI) — the most widely discussed AI training crawler; one of the most commonly blocked user-agents in robots.txt files globally according to Cloudflare 2025 data
- Google-Extended — Google’s token for Gemini and Vertex AI model training only; completely separate from Googlebot; blocking it does not affect Google Search rankings or AI Overviews (which use Googlebot’s standard index)
- anthropic-ai (Anthropic Claude training)
- CCBot (Common Crawl)
- Applebot-Extended
Retrieval Crawlers — They Fetch Your Content to Power AI Answers
These bots index or fetch your pages so AI platforms can cite them in real-time answers. If you block them, you cannot appear in AI-generated responses.
- ChatGPT-User (OpenAI) — activated when a ChatGPT user triggers live web browsing
- OAI-SearchBot (OpenAI search index)
- PerplexityBot — powers Perplexity’s answer corpus
- Claude-Web (Anthropic)
- Amazonbot
The Strategic Choice in 2026
The most common configuration among sophisticated site owners in 2026 is to block training crawlers while allowing retrieval crawlers. This gives you visibility in AI-generated answers without surrendering your content to training datasets without compensation.
| # robots.txt — Balanced AI Strategy # Updated: March 2026 User-agent: Googlebot Allow: / User-agent: Bingbot Allow: / # AI retrieval crawlers — allow to appear in AI answers User-agent: ChatGPT-User Allow: / User-agent: OAI-SearchBot Allow: / User-agent: PerplexityBot Allow: / User-agent: Claude-Web Allow: / User-agent: Amazonbot Allow: / # AI training crawlers — block to protect content User-agent: GPTBot Disallow: / User-agent: Google-Extended Disallow: / User-agent: anthropic-ai Disallow: / User-agent: CCBot Disallow: / User-agent: Applebot-Extended Disallow: / User-agent: * Disallow: /admin/ Disallow: /wp-admin/ Disallow: /internal-search/ Sitemap: https://www.your-site.com/sitemap.xml |
A Warning About Compliance: Not All AI Bots Follow the Rules
Multiple publishers filed legal complaints in 2025 alleging that Perplexity was scraping content from sites that had explicitly blocked it. Cloudflare’s blog documented evidence that undeclared crawlers were bypassing robots.txt directives, a direct violation of RFC 9309. Perplexity disputed the characterization. For critical content protection, layer your protection with a Web Application Firewall (WAF) and IP-range blocking in addition to robots.txt.
Common Robots.txt Mistakes That Are Still Happening in 2026
Blocking the Entire Site with Disallow: /
A developer deploying a staging environment to production accidentally leaves a staging robots.txt in place. Organic traffic drops 90% within 48 hours. Always validate robots.txt using a third-party tester before pushing to production.
Blocking CSS and JavaScript Files
If Googlebot cannot load your CSS or JavaScript files, it cannot understand your layout, navigation, or structured data. Check your Search Console Coverage report for Blocked by robots.txt errors on resource files.
Confusing robots.txt with noindex
Disallow in robots.txt prevents crawling. A noindex tag prevents indexing. If you block a page in robots.txt, Googlebot cannot crawl it and therefore cannot read the noindex tag. The page may still appear in Google’s index if other sites link to it.
Blocking AI Retrieval Crawlers by Accident
A blanket Disallow: / rule for all bots blocks every AI crawler — including retrieval bots that would cite your content in AI answers. Review your existing rules before adding AI-specific directives.
Letting Robots.txt Go Stale After Site Restructuring
A robots.txt written three years ago may be blocking directories that no longer exist. Treat robots.txt like code: version it, review it quarterly, and audit it after every major site restructure.
How to Validate Your Robots.txt File
Google Search Console — Robots.txt Report (Not a Tester)
Important: Google removed the interactive robots.txt tester from Search Console in November 2023. It was replaced with a robots.txt report (found under Settings) that shows which robots.txt files Google found, when each was last crawled, file size, and parsing errors. It does not let you test whether a specific URL is allowed or blocked. Use the report to confirm Google can read your file and to catch parsing errors.
Third-Party Tools for URL-Level Testing
Since Google removed the interactive tester, these are the tools the SEO community now relies on:
- Merkle’s robots.txt tester at technicalseo.com/tools/robots-txt/ — free, uses Google’s own open-source parser library
- Bing Webmaster Tools — still maintains its own interactive robots.txt tester
- TametheBots at tamethebots.com/tools/robotstxt-checker — includes a dedicated AI bot access checker
- Screaming Frog SEO Spider — crawls your site simulating specific user-agents and flags blocked pages still linked internally
Check Your Server Access Logs
Server logs show you exactly which bots are hitting your site, how often, and which pages they are requesting. Reviewing logs quarterly gives you a ground-truth picture of crawler behavior that no other tool provides.
WordPress-Specific Notes for Robots.txt
WordPress generates a default virtual robots.txt if no physical file exists. Plugins like Yoast SEO and Rank Math let you edit this virtual file from inside the dashboard — which prevents conflicts between plugin-generated rules and manual edits.
A common myth: blocking WordPress archive pages, tags, and category pages improves crawl efficiency. This is incorrect. Google has explicitly discouraged it. Use noindex tags on low-value archive pages instead.
| User-agent: * Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Disallow: /wp-login.php Disallow: /?s= Disallow: /search/ Sitemap: https://www.your-site.com/sitemap_index.xml |
The Allow: /wp-admin/admin-ajax.php exception is critical — some themes and plugins rely on this endpoint for front-end functionality, and blocking it can break things for real users.
A Practical 2026 Robots.txt Template for Most Businesses
| # robots.txt # Your Business Name — www.your-site.com # Last updated: March 2026 User-agent: Googlebot Allow: / User-agent: Bingbot Allow: / # AI retrieval bots User-agent: ChatGPT-User Allow: / User-agent: OAI-SearchBot Allow: / User-agent: PerplexityBot Allow: / User-agent: Claude-Web Allow: / # AI training bots User-agent: GPTBot Disallow: / User-agent: Google-Extended Disallow: / User-agent: anthropic-ai Disallow: / User-agent: CCBot Disallow: / User-agent: Applebot-Extended Disallow: / # Default rules User-agent: * Disallow: /admin/ Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Disallow: /wp-login.php Disallow: /?s= Disallow: /internal-search/ Disallow: /checkout/ Disallow: /cart/ Disallow: /account/ Sitemap: https://www.your-site.com/sitemap.xml |
Always deploy to staging first and validate using Merkle’s robots.txt tester or Bing Webmaster Tools before pushing to production.
Frequently Asked Questions About Robots.txt and SEO
Does blocking a page in robots.txt remove it from Google Search?
No. Robots.txt prevents Googlebot from crawling the page — it does not prevent indexing. If other sites link to the blocked page, Google can still index it based on the URL and anchor text. To remove a page from Google Search, use a noindex meta tag or request removal through Google Search Console.
Does Google Search Console have a robots.txt tester?
No — not anymore. Google removed the interactive robots.txt tester in November 2023. What GSC now offers is a robots.txt report (under Settings) showing crawl status, file size, and parsing errors — not URL-level testing. Use Merkle’s robots.txt tester at technicalseo.com, Bing Webmaster Tools, or Screaming Frog for URL-level testing.
Do AI crawlers respect robots.txt?
Most major AI crawlers — including GPTBot (OpenAI), anthropic-ai (Anthropic), and Google-Extended — officially state that they respect robots.txt directives. However, publishers filed legal complaints in 2025 alleging Perplexity was accessing blocked content using undeclared crawlers. Pair robots.txt rules with WAF controls and IP-range blocking for critical content protection.
Will blocking GPTBot affect my Google rankings?
No. GPTBot is operated by OpenAI, not Google. Blocking it has no effect on your Google Search rankings. It does reduce the likelihood that your content will be cited in ChatGPT responses. Blocking ChatGPT-User separately also prevents your content from appearing in ChatGPT’s live web browsing results.
Will blocking Google-Extended affect my Google rankings or AI Overviews?
No to both. Google-Extended is used only for Gemini and Vertex AI model training — completely distinct from Googlebot. Blocking it does not affect Google Search rankings. It also does not affect AI Overviews, because AI Overviews are generated from Googlebot’s standard index, not from Google-Extended’s training crawls.
Where does the robots.txt file need to be placed?
The robots.txt file must be placed in the root directory of your website at https://www.your-site.com/robots.txt. It only applies to the exact domain and protocol — a robots.txt at https://example.com does not apply to http://example.com or blog.example.com.
How often should I review my robots.txt file?
Audit your robots.txt at least once every three months. Review it immediately after any major site migration, CMS update, or structural change. Add the update date as a comment inside the file to track when it was last reviewed.
Should I block all AI bots to protect my content?
Not necessarily. Blocking all AI crawlers means your content cannot appear in AI-generated answers from ChatGPT, Perplexity, or Gemini. A more strategic approach: block training-specific crawlers (GPTBot, Google-Extended) while allowing retrieval crawlers (ChatGPT-User, PerplexityBot) that power AI answers and can drive traffic back to your site.
Does robots.txt affect my crawl budget?
Yes, directly. By blocking low-value URLs — parameter-driven filter pages, internal search results, and admin paths — you redirect Googlebot’s crawl resources toward your most important pages. For large websites, this results in measurably faster indexing of new content.
Technical recommendation: If you have not checked your robots.txt in the past 90 days, open https://www.your-site.com/robots.txt in a browser right now and verify that no critical paths are blocked. Then validate it using Merkle’s robots.txt tester at technicalseo.com/tools/robots-txt/ or Bing Webmaster Tools. Five minutes of auditing can prevent weeks of indexing problems.
- GEO Guide: How to Get Your Brand Cited by AI Tools - July 24, 2026
- 7 Best SEO Books for Beginners and Experts in 2026 - July 17, 2026
- Best SEO Learning Resources for 2026: Blogs, Courses, and Diplomas - July 8, 2026
