Robots.txt Generator & Crawl Budget Optimizer
Build, validate, and optimize RFC 9309 robots.txt files with multi-crawler rule blocks, staging safety switches, Next.js and WordPress presets, and real-time crawl budget diagnostics.
Environment: Production Sitemap: https://example.com/sitemap.xml Block: User-agent: *, Disallow: /admin/, Disallow: /api/Ready locally via WebAssembly & JavaScript
User-agent: * Disallow: /admin/ Disallow: /api/ Sitemap: https://example.com/sitemap.xml100% Client-Side • Zero Server Upload
Before a compliant search engine crawler downloads a single page, stylesheet, or image from your domain, it requests /robots.txt over the exact same scheme, hostname, and port. Formalized as an IETF Internet Standard in RFC 9309 (Robots Exclusion Protocol, September 2022), this plain-text UTF-8 file defines which URL paths automated user-agents may fetch—making it your primary lever for protecting origin server capacity and concentrating search crawl budget on revenue-generating pages. Because a single misplaced slash can de-index an entire production website overnight, our generator validates syntax, flags blocked rendering assets, and scores crawl safety locally in your browser without exposing unreleased site paths or internal directory maps.
RFC 9309 Parsing Rules and Precedence Semantics
Decades of folklore surround robots.txt rule ordering, leading developers to debug phantom issues caused by outdated assumptions. Under RFC 9309, modern parsers—including Googlebot and Bingbot—evaluate directives according to strict deterministic rules:
- Longest-Match Specificity Wins: Rule order inside a group does not dictate precedence. Instead, crawlers match the rule whose path pattern has the longest character length. When an
Allowand aDisallowrule match at identical length, the less restrictiveAllowdirective prevails. - Case-Sensitive Path Matching and Anchors: Directive keys (
User-agent,Disallow,Allow) are case-insensitive, but URL paths are case-sensitive (/Admin/does not match/admin/). Crawlers support*(matches zero or more arbitrary characters) and$(anchors matching to the exact end of the URL, e.g.,Disallow: /*.pdf$). - Percent-Encoding & File Size Limits: Non-ASCII characters inside paths must be UTF-8 percent-encoded. Google enforces a 500 KiB parsing limit on
robots.txtand truncates anything beyond that ceiling. - Host, Protocol, and Port Isolation: Every origin—including subdomains (
blog.example.comvs.www.example.com), schemes (http://vs.https://), and non-standard ports—requires its own independent/robots.txt. A directive deployed on the apex domain never governs a staging subdomain. - HTTP Status Code Behavior: Crawlers treat
2xxresponses as active rule sets,4xxresponses (including404and410) as "no restrictions—crawl everything," and persistent5xxserver errors as a temporary fail-closed halt to avoid overwhelming a degraded origin. If5xxerrors persist beyond ~24–48 hours, crawlers may drop cached rules or suspend crawling altogether.
Verifying Deployment Across Environments
Before shipping a modified robots.txt, confirm with curl -i https://yourdomain.com/robots.txt that the file returns 200 OK with Content-Type: text/plain; charset=utf-8 and zero HTML error-page fallbacks. Switching this builder's environment toggle to Staging or Development emits a clean User-agent: * and Disallow: / block automatically—ideal for automated CI/CD deploy scripts that inject staging guards without risking accidental production de-indexing.
Crawler Directive Matrix Across Search Engines
Not every search engine implements non-core extensions identically. Before relying on Crawl-delay or complex wildcards, verify how major bots interpret each directive:
| Directive / Pattern | Googlebot | Bingbot | Yandex | Baiduspider | Commercial Audit Bots (AhrefsBot, SemrushBot) |
|---|---|---|---|---|---|
Allow Override | Full RFC 9309 longest-match | Full RFC 9309 longest-match | Supported | Supported | Supported |
Wildcard (*) | Full support | Full support | Full support | Partial / inconsistent | Supported |
End Anchor ($) | Full support | Full support | Full support | Unsupported | Supported |
Crawl-delay | Ignored (auto-throttled) | Honored (seconds) | Honored (seconds) | Ignored | Honored (or block via Disallow: /) |
Sitemap (Absolute URL) | Full support (multiple allowed) | Full support | Full support | Supported | Used for site discovery |
Host | Ignored | Ignored | Deprecated (legacy) | Ignored | Ignored |
Crawl Budget Engineering for Frameworks and Faceted URLs
Search engines allocate every host a finite crawl budget governed by two variables: crawl capacity limit (how quickly your server answers without raising latency or 5xx errors) and crawl demand (how popular and frequently updated your URLs are). On small brochure sites, crawl budget rarely bottlenecks indexing; on e-commerce catalogs, SaaS apps, and modern JavaScript frameworks, uncontrolled parameter combinations can waste 70%+ of crawler requests.
# Next.js + E-Commerce Crawl Budget Template
User-agent: *
Allow: /_next/static/
Disallow: /_next/
Disallow: /api/
Disallow: /checkout/
Disallow: /*?sort=
Disallow: /*?filter=
Disallow: /*?utm_
# Throttle bandwidth-heavy third-party SEO scrapers
User-agent: AhrefsBot
Disallow: /
User-agent: SemrushBot
Disallow: /
Sitemap: https://example.com/sitemap.xml
Watch out for two classic production traps illustrated above:
- Never Block JavaScript or CSS Rendering Bundles: Googlebot renders pages with a headless evergreen Chromium engine. Blocking
/_next/static/,/static/css/, or/wp-includes/js/blinds Google's renderer, breaks Core Web Vitals mobile-usability checks, and degrades rankings. Always pairDisallow: /_next/with the longer, higher-specificityAllow: /_next/static/. - User-Agent Group Isolation: If you create a dedicated
User-agent: Googlebotsection to add one special rule, Googlebot completely ignores theUser-agent: *block. Always repeat every baselineDisallowrule inside specialized search-engine blocks, and declare your full canonical URL inventory viaSitemap:directives built with our XML Sitemap Generator.
Separating Crawl Control from De-Indexing and Security
Two architectural misunderstandings cause persistent SEO and security incidents:
- Crawling vs. Indexing: Blocking
/old-promo/inrobots.txtstops crawlers from downloading the HTML, which also stops them from ever reading a<meta name="robots" content="noindex">directive inside that page. If external links point to/old-promo/, Google can still keep the URL indexed with a "No information is available for this page" placeholder. To remove URLs cleanly from search results, leave the path crawlable and emit anoindexmeta tag configured via our Meta Tag Generator. - Crawler Etiquette vs. Access Control:
robots.txtis purely voluntary. Malicious scrapers, credential stuffers, and vulnerability scanners routinely ignoreDisallowrules—and frequently read/robots.txtspecifically to discover hidden/admin/or/backup/directories. Enforce real access restrictions, IP blacklists, and403 Forbiddenuser-agent filters at the web server layer using our .htaccess Generator or reverse proxy firewall.
How to Use Robots.txt Generator & Crawl Budget Optimizer
Choose your deployment environment (Production, Staging, or Development) to ensure pre-production servers default to a safe full crawl block.
Select one of the nine platform presets (such as Next.js Website, WordPress Standard, or E-Commerce) or build custom User-agent groups from scratch.
Assign one or more crawler tokens per block and add Allow, Disallow, or Crawl-delay directives using clean leading-slash paths without spaces.
Add absolute https:// XML sitemap URLs under Global Directives so every visiting bot discovers your canonical URL inventory immediately.
Inspect the live Safety Score, Crawl Budget Score, validation alerts, and four-engine compatibility matrix to resolve conflicts like blocked JS/CSS folders or duplicate bot groups.
Download the ready-to-deploy robots.txt file for your domain root or export the JSON configuration for team version control.
Real Examples
Standard Production Configuration
Default robots.txt config for blogs and standard sites, including sitemap linking.
Environment: Production
Sitemap: https://example.com/sitemap.xml
Block: User-agent: *, Disallow: /admin/, Disallow: /api/User-agent: *
Disallow: /admin/
Disallow: /api/
Sitemap: https://example.com/sitemap.xmlComplete Staging/Development Block
Block all crawlers from accessing staging websites to prevent Google index bloating.
Environment: Staging
Sitemap: noneUser-agent: *
Disallow: /SEO Scraper Block
Block commercial SEO indexing bots from crawling and draining your server bandwidth.
Environment: Production
Block 1: User-agent: AhrefsBot, SemrushBot, DotBot, Disallow: /
Block 2: User-agent: *, Disallow: /admin/User-agent: AhrefsBot
User-agent: SemrushBot
User-agent: DotBot
Disallow: /
User-agent: *
Disallow: /admin/Frequently Asked Questions
Does adding a URL to robots.txt remove it from Google search results?
How do crawlers resolve conflicting Allow and Disallow rules under RFC 9309?
What happens if I add a dedicated User-agent: Googlebot block below User-agent: *?
Why does the validator warn when I add Crawl-delay for Googlebot?
Is it safe to list private admin panels or internal APIs in robots.txt?
Key Features
- Environment mode toggle switching cleanly between Production rules and fail-safe Staging/Development full-site crawl blocks (Disallow: /)
- Multi-user-agent block editor with 13 preset crawler tokens (Googlebot, Bingbot, AdsBot-Google, Yandex, Baiduspider, AhrefsBot, SemrushBot, and wildcard *) plus priority reordering
- Nine framework and vertical templates covering Next.js 15, WordPress, E-Commerce, SaaS, Blog, News, Forum, Portfolio, and Developer Tools
- Live Safety Score and Crawl Budget Score (0–100) detecting accidental Disallow: / de-indexing, blocked CSS/JS/_next/static assets, duplicate user-agents, path whitespace, and relative sitemap URLs
- Four-engine compatibility analyzer comparing Google, Bing, Yandex, and Baidu support for wildcards (*, $), Allow overrides, and Crawl-delay
- Syntax-highlighted real-time preview with one-click robots.txt download and JSON template import/export processed strictly in-browser
Common Use Cases
- Preventing crawl budget waste on e-commerce stores with infinite faceted filters (?sort=, ?filter=, ?utm_) and checkout URLs
- Allowing Googlebot to fetch Next.js /_next/static/ CSS and JS chunks while blocking internal /_next/ and /api/ endpoints
- Keeping staging, QA, and preview deployments out of public search indices with a one-click staging environment toggle
- Throttling or blocking resource-heavy commercial SEO audit crawlers (AhrefsBot, SemrushBot, MJ12bot, DotBot) to lower origin CPU load
- Exposing multiple XML sitemap index URLs at the root of large multilingual or multi-subdomain publishing architectures
- Auditing inherited WordPress robots.txt rules to ensure /wp-admin/admin-ajax.php remains accessible while internal search queries (?s=) stay blocked
Related Tools
Explore More Tools in This Category
View All Developer & Utility ToolsSitemap.xml Generator & Index Builder
Build valid standard, image, video, and news XML sitemaps or multi-file sitemap indexes with framework presets, real-time protocol validation, and automatic 45,000-URL ZIP partitioning — 100% client-side.
.htaccess Generator & Apache Rewrite Builder
Build production-ready Apache 2.4 and 2.2 .htaccess configurations covering canonical 301/302 redirects, HTTPS enforcement, mod_deflate compression, caching headers, IP blocking, and 503 maintenance windows.
Responsive Screen Tester & Multi-Device Simulator
Test how your website appears across mobile, tablet, laptop, and custom screen sizes in real-time. Features zoom controls, grid guides, and side-by-side device comparisons.
HTTP Header Checker & Security Analyzer
Inspect and analyze HTTP response headers, verify CORS policies, test redirects, check SSL/HSTS configuration, and audit security headers in real-time.
Free URL Redirect Checker
Trace URL redirects instantly. Our free Redirect Checker detects 301, 302, and 307 redirects, uncovering hidden redirect chains and loops to fix your SEO.
Website Screenshot Tool
Capture pixel-perfect screenshots of any website in multiple device resolutions. Generate full-page captures, test responsiveness, analyze SEO meta tags, and measure page load performance.
DNS Lookup Tool & Domain Analyzer
Inspect DNS records (A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR), analyze SPF/DMARC mail security, detect hosting/nameserver providers, and diagnose resolution issues.
IP Lookup Tool & Geolocation Analyzer
Inspect any IP address (IPv4/IPv6) to discover details about its geolocation, ISP network provider, ASN registration, reverse DNS hostname, proxy/VPN status, and threat metrics.