Starter Kit - Ships with your template. You own it - modify freely.
Overview
The Robots.txt ensemble generates a standards-compliantrobots.txt file for controlling search engine crawler behavior. It provides a flexible, configurable approach to managing bot access with support for:
- Block all crawlers or allow with exceptions
- Custom path restrictions (e.g.,
/api/*,/admin/*) - Crawl delay configuration
- Sitemap reference
- CDN/browser caching (24-hour cache by default)
robots.txt at the /robots.txt endpoint with proper HTTP cache headers for optimal performance.
Endpoint
text/plain
Cache Headers:
Cache-Control: public, max-age=86400, stale-while-revalidate=3600- 24-hour cache duration
- 1-hour stale-while-revalidate window
Configuration Options
disallowAll
Type: boolean
Default: false
Description: When true, blocks all search engine crawlers from accessing any part of your site.
disallowPaths
Type: array of strings
Default: ["/api/*", "/admin/*", "/_*"]
Description: List of path patterns to disallow. Supports wildcards (*). Only applied when disallowAll is false.
crawlDelay
Type: number (seconds)
Default: null (no delay)
Description: Requests crawlers to wait this many seconds between successive requests. Helps reduce server load.
sitemap
Type: string (URL)
Default: https://example.com/sitemap.xml
Description: URL to your XML sitemap. Search engines use this to discover all pages on your site.
Customization Examples
Example 1: Development Site (Block All)
Block all crawlers during development or staging:Example 2: Production Site with Protected Paths
Allow crawlers but protect sensitive paths:Example 3: Public Site with Minimal Restrictions
Allow most content, only block internal paths:Example 4: Aggressive Crawler Throttling
Slow down aggressive bots:Full Ensemble YAML
Testing Your Configuration
Test Locally
Validate with Google
After deploying, use Google’s Robots Testing Tool to validate your robots.txt configuration.Common Scenarios
Scenario 1: Verify API paths are blockedBest Practices
- Update the sitemap URL: Replace
https://example.com/sitemap.xmlwith your actual sitemap URL - Review default disallow paths: Customize the
disallowPathsarray to match your site structure - Consider crawl delay: Set
crawlDelayonly if experiencing high bot traffic - Test before deploying: Always test changes locally first
- Monitor crawler behavior: Use Google Search Console to track how bots interact with your site
- Keep it simple: Only disallow what’s necessary; over-blocking can hurt SEO
Related Resources
Sitemap Generator
Generate XML sitemaps for search engines to discover your content

