Robots.txt Generator
Create a valid robots.txt from user-agent groups, allow and disallow rules, crawl-delay, and sitemap entries. Copy or download the finished file for free.
What is a robots.txt generator?
A robots.txt generator creates the plain-text robots.txt file that tells automated crawlers which parts of a website they may request. The file lives at the root of a domain, for example https://example.com/robots.txt, and is read by search engines, scraper bots, monitoring tools, and any other client that respects the standard.
Writing the file by hand is easy for two rules and error-prone once a site grows. Common mistakes include missing slashes, a stray space in a path, duplicate user-agent groups that override each other, or a Sitemap line that points to a relative URL. A generator normalizes directive casing, validates each path, flags conflicting groups, and produces a clean file you can drop into production.
robots.txt controls crawling, not indexing. A Disallow rule stops most bots from requesting a page, but it does not keep an already-indexed URL out of search results. If a page should not appear in Google, the page itself needs a noindex directive as well. For crawlers, robots.txt is a cooperation signal: well-behaved bots honor it, so keep the rules precise and test them after every change.
How to read and use a robots.txt generator
Choose your user-agents
Use User-agent: * for all crawlers, or create separate groups for Googlebot, Bingbot, and other specific clients.
Add allow and disallow rules
List the paths crawlers should skip with Disallow and the exceptions with Allow. Paths must start with / and match from the root.
Generate and test
Copy or download robots.txt, upload it to the domain root, then verify specific URLs with the Lection Robots.txt Tester.
Read the generated file from top to bottom. User-agent starts a rule group that applies until the next user-agent line. Within a group, crawlers apply the most specific matching rule: Disallow: /wp-admin/ blocks everything under that folder, while Allow: /wp-admin/admin-ajax.php re-opens one exception path. An empty Disallow: means the group blocks nothing, and Disallow: / blocks the entire site.
For example, a typical WordPress setup keeps crawlers out of private and duplicate areas while pointing search engines at the sitemap:
# robots.txt generated with Lection (free tool)
User-agent: *
Disallow: /wp-admin/
Disallow: /feed/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap.xmlThe Sitemap: line is optional but useful: it advertises the location of your sitemap.xml so crawlers discover it without a reference in Google Search Console. Only absolute URLs are valid there. Crawl-delay: is a legacy directive that Google ignores and only some other crawlers honor, so treat it as a hint, not a guarantee.
Common Use Cases
- Generating a first robots.txt before a new site or subdomain goes live.
- Blocking search engines from admin panels, carts, checkouts, and internal search pages.
- Keeping aggressive scraper bots with a known user agent off heavy endpoints.
- Advertising sitemap locations so crawlers find new content faster.
- Pausing crawling during a migration or maintenance window with a temporary Disallow: /.
- Standardizing crawl rules across multiple domains before testing them with a robots.txt tester.
FAQ
What is a free robots.txt generator used for?
What is the difference between Disallow and Allow in robots.txt?
Does robots.txt stop a page from being indexed?
How do I block all crawlers with robots.txt?
Can I set different rules for Googlebot and other crawlers?
Should I add a Sitemap line to robots.txt?
What happens if two rules match the same URL?
Is Crawl-delay still supported by search engines?
Related Resources
Robots.txt Analyzer
Inspect an existing robots.txt and confirm your directives are readable by crawlers.
Open tool →Robots.txt Tester
Test specific URL paths against your generated rules and the winning directive.
Open tool →XML Sitemap Generator
Build the sitemap.xml that pairs with the Sitemap line in your robots.txt.
Open tool →Complete Guide to Robots.txt
Understand how robots.txt is read by search engines and scraper bots.
Open tool →Web Scraping Legality by Country
Review the legal side of crawling sites that do or do not set robots.txt rules.
Open tool →If you want to move from one-off robots.txt cleanup to repeatable site analysis, start on the Lection home page or compare workflow depth on the pricing page.