robots.txt Generator — Build and Download robots.txt Free
A correctly configured robots.txt file is one of the first things to set up on any website. It tells search engines which parts of the site to crawl and which to skip, helps manage crawl budget for large sites, and is the primary tool for blocking AI training bots from accessing your content. Getting the syntax wrong — an incorrect path, a missing blank line between blocks, or a misnamed directive — can silently cause crawling issues.
The robots.txt File Format
A robots.txt file consists of one or more blocks, each beginning with a User-agent directive. Each block applies to the specified bot and contains any number of Allow and Disallow directives. Blocks are separated by blank lines. Global directives like Sitemap and Host appear outside any user-agent block, typically at the end of the file. Lines beginning with # are comments and are ignored by parsers.
Crawl Budget and Large Sites
Search engines allocate a fixed crawl budget to each domain — a limit on how many pages they crawl and how frequently. For small sites this is rarely a concern, but for large e-commerce sites, news sites, or sites with extensive URL parameter variations, managing crawl budget becomes important. Disallowing low-value URLs — paginated filtered pages, internal search results, session-ID URLs, print versions — conserves crawl budget for content that should be indexed.
Blocking AI Training Bots
Since 2023, several AI companies have introduced user-agent strings for their training crawlers. OpenAI's GPTBot crawls content for ChatGPT and other OpenAI models. Anthropic's ClaudeBot crawls for Claude. Common Crawl's CCBot feeds many open-source models. To opt out, add a Disallow: / rule for each of these user-agents. This is the officially supported method for controlling AI training data collection.
Testing Your robots.txt
After deploying a robots.txt file, verify it with Google Search Console's robots.txt Tester, which shows you how Googlebot interprets your rules and lets you test specific URLs. Bing Webmaster Tools offers a similar feature for Bingbot. Always test after making changes, especially when using wildcard patterns, as incorrect patterns can accidentally block important content from being crawled.