Most robots.txt guides cover the basics: Disallow to block folders, Allow to override specific files, User-agent to target specific bots. In 2026, robots.txt has become significantly more important β not just for managing Googlebot, but for controlling the increasingly aggressive AI training crawlers that can consume significant server resources and create content scraping concerns.
This guide covers the advanced applications that basic guides miss, including the directives most sites should be using but are not.
The robots.txt Fundamentals Done Correctly
Before advanced strategies, verify the fundamentals are correct. The three most common robots.txt mistakes that actively harm SEO:
Blocking CSS and JavaScript files. A robots.txt that disallows /wp-content/ or /assets/ blocks the CSS and JavaScript Googlebot needs to render pages correctly. As we covered in our guide to JavaScript SEO, Googlebot must be able to access all page resources. Check with Google's robots.txt Tester in Search Console.
Missing trailing slashes on directory blocks. Disallow: /admin blocks /admin but also /administration, /admins, and any other path starting with /admin. Use Disallow: /admin/ (with trailing slash) to block only that specific directory.
Case sensitivity errors. robots.txt is case-sensitive for path matching. Disallow: /Blog/ does not block /blog/ on a Linux server. Use our site scanner to verify that pages you intend to block are not being indexed despite your robots.txt rules.
Controlling Crawl Rate with Crawl-Delay
The Crawl-delay directive tells crawlers to wait a specified number of seconds between requests. This is not supported by Googlebot (which uses Search Console's crawl rate setting instead) but is respected by Bing, Yandex, and most other crawlers.
User-agent: Bingbot
Crawl-delay: 10
For sites with limited server capacity or shared hosting, setting crawl delays for non-Google bots prevents them from overwhelming your server during peak traffic periods. Use this for AI training crawlers particularly β they often crawl aggressively and the crawl delay significantly reduces their server impact.
Managing AI Training Crawlers in 2026
In 2026, numerous AI companies run web crawlers to collect training data. The major ones include GPTBot (OpenAI), Google-Extended (Google's AI training crawler separate from Googlebot), CCBot (Common Crawl), and ClaudeBot (Anthropic). Unlike Googlebot, these crawlers provide no search visibility benefit β they collect content for AI training purposes.
If you want to block AI training crawlers while allowing Googlebot, add specific user-agent blocks:
User-agent: GPTBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: anthropic-ai
Disallow: /
Note: Blocking Google-Extended does not affect your regular Google Search rankings β it only prevents your content from being used in Google's AI training datasets and AI Overview generation. This is a content creator's choice, not an SEO requirement.
Prioritising Crawl Budget with Allow Overrides
As we covered in our guide to crawl budget, you want Googlebot spending its crawl allocation on your most valuable pages. Use robots.txt to block categories of pages that consume crawl budget without contributing to rankings:
# Block URL parameters that create duplicate content
Disallow: /*?sort=
Disallow: /*?filter=
Disallow: /*?ref=
# Block internal search results
Disallow: /search?
# Block login and account areas
Disallow: /my-account/
Disallow: /checkout/
Disallow: /cart/
The Sitemap Reference
Every robots.txt should include a Sitemap directive pointing to your sitemap URL:
Sitemap: https://yourdomain.com/sitemap.xml
This ensures every crawler β not just Googlebot β can find your sitemap. Place this at the end of your robots.txt file. As we covered in our guide to building sitemaps, your sitemap URL should always be the clean .xml URL even if it is served by a PHP file via .htaccess rewrite.
Testing and Validating robots.txt
Use Google Search Console's robots.txt Tester to verify that the pages you want blocked are actually blocked and the pages you want crawled are not accidentally blocked. Test both positive cases (should be blocked) and negative cases (should not be blocked).
Summary
Advanced robots.txt in 2026 requires blocking CSS/JavaScript files correctly, using trailing slashes on directory blocks, setting Crawl-delay for non-Google bots, explicitly blocking AI training crawlers if content protection is a concern, using wildcard parameter blocks for duplicate content prevention, and including a Sitemap directive. Validate with Search Console's tester and verify indexed pages with our site scanner.
Continue reading: Crawl Depth and Click Depth: How Site Architecture Affects What Google Indexes