Free online tool
Robots.txt Generator
Pick your policy and generate a robots.txt file ready to upload to your site root.
User-agent: * Allow: /
What is robots.txt?
robots.txt is a plain text file at the root of your website that tells search-engine crawlers which pages they may or may not visit. It's the first file most bots request when they land on your domain.
How to use the generator
Choose whether to allow everything, block everything, or specify custom disallow rules. Optionally add a Sitemap line so crawlers can discover your sitemap.xml. Save the result as robots.txt in the root of your website (so it's reachable at yoursite.com/robots.txt).
Important notes
Robots.txt is a suggestion, not a security control — well-behaved bots respect it, but malicious scrapers ignore it. Never rely on it to hide sensitive URLs; use authentication for that.
+Where do I put the file?
Upload it to your site root so it's served at yourdomain.com/robots.txt.
+Can I have multiple User-agent blocks?
Yes. This generator produces a single wildcard block; for per-crawler rules you can add more blocks by hand.
Controlling what crawlers are allowed to touch
robots.txt sits at the root of your domain and tells well-behaved crawlers which paths they may request, but it is a set of instructions, not a security wall: it does not prevent a page from being indexed if something else links to it, and it does nothing to block crawlers that ignore the standard.
This generator helps you assemble the file block by block, including user-agent targeting, crawl-delay where it's still respected, and a sitemap reference, so you end up with syntax crawlers can actually parse instead of a hand-edited file with a stray typo.
Disallow versus noindex, a distinction that trips people up
Disallowing a URL in robots.txt stops crawling, but if the URL is already linked from elsewhere, Google can still show it in results as a bare link with no snippet, because it never fetched the page to know what's on it. If your goal is to keep a page out of search results entirely, use a noindex meta tag or header on the page itself and let it be crawled so the directive is actually seen.
Structuring rules by user-agent
You can target specific bots with their own User-agent block, such as separating Googlebot from an aggressive scraper, and each block needs its own Disallow and Allow lines since crawlers do not inherit rules from a wildcard block once a more specific block matching their name exists.
Always include a Sitemap line pointing to your sitemap.xml at the bottom of the file; it costs nothing and gives crawlers a direct path to your full URL list instead of relying purely on discovery through links.
The mistake that de-indexes an entire site
A stray Disallow: / left over from a staging environment, deployed to production, will block crawling of the whole domain. Always test the generated file against Google Search Console's robots.txt report after publishing, and double check any wildcard pattern before pushing it live.
Blocking AI and scraping bots without blocking search engines
A growing number of site owners want to allow Googlebot and Bingbot while restricting bots used for AI training or aggressive scraping. This means adding separate User-agent blocks by exact name, since a generic wildcard Disallow would also cut off the search crawlers you actually depend on for visibility, and bot names change over time so this list needs occasional review.
Parameters, faceted navigation, and crawl budget
Sites with filterable listings, like e-commerce category pages with size and color parameters, can generate near-infinite URL combinations that waste crawl budget on duplicate content. Disallowing common parameter patterns, such as anything containing ?sort= or &filter=, keeps crawlers focused on canonical pages instead of spending their budget on thousands of near-identical variants.
People also search for
- robots.txt generator
- disallow vs noindex
- block crawlers from website
- robots.txt syntax examples
- sitemap in robots.txt
- block ai bots robots.txt
- user-agent disallow rules
- crawl budget optimization