Online Robots.txt Generator & Validator
Generate clean, error-free robots.txt files for search engine web crawlers. Specify custom allow and disallow paths, configure crawl-delays, and declare XML sitemaps to optimize your site's crawl budget.
User Agents Configuration
Test URL Access
User-agent: *
Live Access Preview
| User-agent | / | /cart | /checkout | /blog |
|---|---|---|---|---|
| * | Allowed ✅ | Allowed ✅ | Allowed ✅ | Allowed ✅ |
Comprehensive Guide to Robots.txt: Syntax, Crawl Budgets & Technical SEO Best Practices
Every major search engine begins its discovery lifecycle by requesting your website's /robots.txt file. Standardized under RFC 9309 (Robots Exclusion Protocol), this lightweight plain-text file acts as the primary gatekeeper between your web server and automated crawler bots, instructing them on which server resources they are authorized to request and crawl.
A well-crafted robots.txt file preserves precious server CPU cycles, eliminates crawl traps, prevents indexing of duplicate administrative screens, and accelerates the discovery of newly published editorial articles. Conversely, a single misplaced slash (e.g. Disallow: /) can de-index an entire million-dollar online enterprise from Google search overnight.
Core Directives of the Robots Exclusion Protocol
Robots.txt syntax is structured into distinct rule blocks identified by user-agent headers:
| Directive | Syntax Example | Function & SEO Impact |
|---|---|---|
| User-agent | User-agent: Googlebot | Identifies which specific crawler the subsequent rules apply to. Asterisk * denotes all compliant web bots. |
| Disallow | Disallow: /admin/ | Forbids the targeted bot from requesting any URL starting with that path prefix. Leaving it empty (Disallow:) permits all access. |
| Allow | Allow: /admin/login | Overrides a broader Disallow rule, permitting access to a specific subpath within an otherwise blocked directory. |
| Sitemap | Sitemap: https://example.com/sitemap.xml | Declares the absolute HTTPS URL of your XML sitemap, allowing search engines to discover all canonical routes immediately. |
| Crawl-delay | Crawl-delay: 5 | Requests that bots (like Bingbot and Yandex) wait the specified number of seconds between requests to avoid server CPU overload. |
Mastering Wildcard Pattern Matching (* and $)
Modern search engines support flexible pattern matching using wildcard operators:
The Asterisk (*) Wildcard
Matches any sequence of zero or more characters.
Disallow: /*?sort=*
Disallow: /*/temp/*Blocks all faceted sorting URLs containing query strings without impacting clean canonical URLs.The Dollar Sign ($) End-of-URL Anchor
Asserts that the match must occur at the very end of the URL path.
Disallow: /*.pdf$
Disallow: /*.zip$Blocks direct crawling of raw PDF downloads without blocking landing pages like /pdf-tools/.Crawl Budget Optimization for High-Scale Websites
Google does not have unlimited time to spend crawling your server. Crawl Budget is the number of URLs Googlebot can and wants to crawl on your site during a given timeframe. If your website has 50,000 URLs, but 35,000 are duplicate faceted filter permutations (e.g. ?color=blue&size=xl&view=grid), Googlebot may exhaust its crawl budget on duplicate filters and fail to discover newly published blog posts or products.
By adding targeted Disallow directives for filter parameters, internal search results pages (Disallow: /search?*), and session-tracking parameters, you funnel 100% of the crawler's attention toward your high-value canonical pages.
8 Critical Robots.txt Mistakes to Avoid
- Blocking CSS and JavaScript: Never write
Disallow: /css/orDisallow: /_next/. Google must render scripts to evaluate responsive design and content layout. - Using Robots.txt for Sensitive Security: Robots.txt is a publicly viewable file. Never list secret admin URLs, internal staging paths, or unreleased product URLs in it, as malicious bots scrape robots.txt to discover hidden attack targets. Use HTTP authentication instead.
- Confusing Disallow with Noindex: Disallow stops crawling, not indexing. If an external backlink points to a disallowed URL, Google will still index the empty URL stub. To de-index, use
<meta name="robots" content="noindex" />. - Incorrect File Location: The file must be accessible at
https://yourdomain.com/robots.txt. A subfolder path like/assets/robots.txtis completely ignored. - Wrong Casing: Robots.txt directives and URL paths are case-sensitive.
Disallow: /admin/does not block/Admin/. - Leaving Staging Rules in Production: Deploying a staging robots.txt containing
Disallow: /to production will wipe your entire organic search traffic within days. - Relative Sitemap URLs: Always specify the full absolute URL for sitemaps including protocol (e.g.
https://www.example.com/sitemap.xml). - Missing File Encoding: Robots.txt must be saved as standard UTF-8 without Byte Order Mark (BOM).
Frequently Asked Questions (Robots.txt FAQs)
Explore Related Tools
Hand-picked utilities and calculators related to this tool.