Robots.txt Generator
Generate a valid robots.txt file in seconds to control how search engine crawlers access your website.
Configure Your Rules
Live Preview
1# robots.txt generated by Incrementors2User-agent: *3Disallow: /wp-admin/4Allow: /wp-admin/admin-ajax.phpReady-Made Templates
One click populates the generator with sensible rules for your platform.
Robots.txt Validator
Paste an existing robots.txt file to check it for syntax and SEO problems.
Run the validator to see results here.
Robots.txt Best Practices
Keep robots.txt in the root folder
Crawlers only look at https://yourdomain.com/robots.txt. A file in a subfolder is ignored completely.
Always add your sitemap
A Sitemap: directive helps search engines discover every indexable URL, even ones with few internal links.
Never block CSS
Google renders pages like a browser. Blocking stylesheets can make your pages look broken to the crawler.
Never block JavaScript
Blocked JS prevents Google from seeing content that loads client-side, which can hurt rankings badly.
Test before uploading
Validate the file here and re-check it in Google Search Console's robots.txt report after publishing.
Use lowercase, exact paths
Robots.txt paths are case-sensitive. /Private/ and /private/ are two different rules.
Don't accidentally block your site
A stray 'Disallow: /' under 'User-agent: *' removes your whole site from crawling. Double-check before shipping.
Common Robots.txt Examples
Proven starting points for popular platforms and site types.
WordPress
1User-agent: *2Disallow: /wp-admin/3Disallow: /wp-includes/4Allow: /wp-admin/admin-ajax.php5 6Sitemap: https://example.com/sitemap_index.xmlWooCommerce
Shopify
News Website
Portfolio
Agency
Blog
How to Use This Tool
Enter your website rules: pick a user agent, then add Allow and Disallow paths.
Generate robots.txt — the live preview updates instantly as you type.
Download the robots.txt file (or copy it to your clipboard).
Upload it to your website root so it serves at https://yourdomain.com/robots.txt.
Test the file in Google Search Console's robots.txt report to confirm nothing important is blocked.
What Is a Robots.txt File?
A robots.txt file is a small plain-text document that lives in the root directory of your website and tells automated crawlers which parts of the site they may request. It is the practical implementation of the Robots Exclusion Protocol, a convention that has guided search engine behaviour since 1994 and was finally formalised as an internet standard (RFC 9309) in 2022. When Googlebot, Bingbot, or any other well-behaved crawler visits your domain, the very first URL it usually fetches is https://yourdomain.com/robots.txt. Whatever it finds there shapes every request that follows.
The syntax is deliberately simple. Rules are organised into groups, each starting with a User-agent line that names the crawler the group applies to, followed by one or more Allow and Disallow directives that describe URL paths. Optional directives such as Sitemap, Crawl-delay, and Host add further instructions. Because the format is so terse, a single misplaced slash can have site-wide consequences — which is exactly why generating and validating the file with a tool is safer than editing it by hand.
Why Robots.txt Matters for SEO
Search engines do not crawl every URL on every site every day. Each domain has an effective crawl budget determined by the site's authority, server responsiveness, and the perceived value of its content. If crawlers spend that budget on faceted-navigation permutations, internal search results, session-ID URLs, printer-friendly duplicates, or an endless calendar archive, they have less capacity left for the pages that actually earn traffic. Robots.txt is the cheapest, fastest lever you have for redirecting that attention.
There is also a server-load dimension. Aggressive crawling of heavy, database-driven pages can slow a site down for real users. Blocking low-value dynamic paths — or, for crawlers that honour it, adding a modest Crawl-delay — protects performance without harming discoverability of your commercial pages. Finally, the Sitemap directive turns robots.txt into a discovery hub: any crawler that reads the file immediately learns where your complete URL inventory lives, which is particularly valuable for large sites and for pages that are only weakly linked internally.
How Search Engines Use Robots.txt
When a crawler requests robots.txt, it caches the response — Google typically for up to 24 hours — and applies the rules to every subsequent request against that host. Matching is done on URL paths, and it is case-sensitive: /Private/ and /private/ are different rules. Google supports two wildcards: * matches any sequence of characters, and $ anchors a rule to the end of a URL. So Disallow: /*?sort= blocks every sorted listing URL, and Disallow: /*.pdf$ blocks PDF files specifically.
When several rules could apply to the same URL, Google follows the most specific match by character length rather than by document order. That means Allow: /wp-admin/admin-ajax.php correctly overrides Disallow: /wp-admin/, because the Allow path is longer and therefore more specific. Crawler selection works the same way: a group targeting User-agent: Googlebot takes precedence over the catch-all User-agent: * group for Google, and the catch-all group is then ignored entirely for that crawler — a subtlety that surprises many site owners who assume the groups combine.
HTTP status codes matter too. A 404 or 410 response is treated as "no restrictions" and crawling proceeds normally. A 5xx response, on the other hand, signals that the rules are temporarily unknown, and Google may slow or pause crawling of the whole host until the file becomes reachable again. Never let robots.txt fail with a server error.
Robots.txt vs Noindex: The Difference That Trips Everyone Up
Robots.txt controls crawling. A noindex directive — issued as a meta robots tag in the HTML head or as an X-Robots-Tag HTTP header — controls indexing. They solve different problems, and confusing them causes one of the most common technical SEO failures.
If you disallow a URL in robots.txt, crawlers will not fetch it. But if other pages link to that URL, search engines may still list it in results using anchor text and third-party signals, showing a snippet-less entry with the note that no description is available. Worse, because the page was never fetched, any noindex tag inside it is never seen. The correct sequence for removing a page from search is: allow crawling, serve noindex, wait for the page to drop out of the index, and only then consider blocking the path in robots.txt if you also want to save crawl budget.
Use robots.txt when a section is worthless to crawl at all — infinite parameter combinations, internal search, cart and checkout flows. Use noindex when a page must be reachable and rendered but should not compete in search results — thin tag archives, thank-you pages, or gated landing-page duplicates.
Common Robots.txt Mistakes
The most damaging mistake is shipping a staging configuration to production. Development environments frequently carry Disallow: / to keep them out of search, and when that file is deployed alongside a redesign, organic traffic collapses within days. Always check the live robots.txt immediately after any launch.
Blocking CSS and JavaScript is the second classic error. Google renders pages with a headless browser; if your stylesheets and scripts are unreachable, it evaluates a broken, unstyled version of the page and may misjudge mobile usability, layout, and even the presence of content. Modern SEO guidance is unambiguous: leave rendering resources crawlable.
Other frequent problems include using robots.txt as a security measure (the file is public, so listing /secret-admin/ advertises exactly what you wanted hidden), writing relative sitemap paths instead of absolute URLs, assuming that Crawl-delay works for Googlebot (it does not — use the crawl-rate settings in Search Console instead), placing the file somewhere other than the root, and adding rules for a hostname rather than a path. Duplicated and contradictory directives also accumulate over time as different teams edit the file; periodic validation keeps it clean.
SEO Benefits of a Well-Structured Robots.txt
A well-maintained robots.txt file concentrates crawl budget on revenue pages, reduces duplicate-content noise from parameterised URLs, speeds up discovery of new content through the sitemap directive, lowers unnecessary server load, and gives you a single documented place to express crawling policy for every bot that visits your site — including the growing population of AI crawlers you may want to permit or restrict.
None of that happens automatically. The file needs to reflect your actual URL structure, be reviewed after every platform migration or redesign, and be validated whenever it changes. Generate your file above, run it through the validator, upload it to your root directory, and confirm the result in Google Search Console.
Related Free SEO Tools
Pair your robots.txt with the rest of our technical SEO toolkit:
- SEO Audit Tool — find crawl, indexing, and on-page issues across your site.
- Meta Tags Generator — build title, description, and social tags.
- XML Sitemap Generator — create the sitemap you reference in robots.txt.
- URL Builder — build clean, trackable campaign URLs.
- Local Business Schema Generator — add structured data for local search.
Frequently Asked Questions
Everything you need to know about our services
What is robots.txt?
Robots.txt is a plain-text file in your site's root directory that tells search engine crawlers which URLs they may request. It follows the Robots Exclusion Protocol and is the first file most crawlers fetch when they visit your domain.
Where should robots.txt be uploaded?
It must live at the root of the domain or subdomain, for example https://example.com/robots.txt. A file placed in a subfolder such as /blog/robots.txt is ignored by search engines.
Can robots.txt block Google?
Yes. Adding 'Disallow: /' under 'User-agent: *' asks Google to stop crawling your entire site. Blocked URLs can still appear in search results without a description if other sites link to them, so use noindex for true removal.
Does robots.txt improve SEO?
Indirectly. It focuses crawl budget on valuable pages, keeps duplicate and transactional URLs out of the crawl queue, and points crawlers to your sitemap — all of which help important pages get discovered and refreshed faster.
Should I block CSS files?
No. Google renders pages the way a browser does. Blocking CSS or JavaScript prevents correct rendering and can lead to mobile-usability and ranking problems.
What is Sitemap in robots.txt?
The Sitemap directive lists the absolute URL of your XML sitemap, for example 'Sitemap: https://example.com/sitemap.xml'. It helps crawlers discover every indexable URL, even pages with few internal links.
How do I test robots.txt?
Paste the file into the validator on this page to catch syntax problems, then use the robots.txt report in Google Search Console to confirm how Google interprets each rule against live URLs.
Can robots.txt hide pages?
No. Robots.txt controls crawling, not indexing, and the file itself is publicly readable. To hide content, use noindex meta tags, HTTP authentication, or server-side access control.
What happens if robots.txt is missing?
If the file returns a 404, crawlers assume everything is allowed and crawl the site normally. A 5xx error is different — search engines may pause crawling until the file responds correctly.
Is robots.txt required?
It is not mandatory, but it is strongly recommended for any site with admin areas, faceted navigation, staging paths, or a large URL footprint where crawl budget matters.
More Free Tools
Need More Than Just Tools?
Our SEO experts can help you implement comprehensive strategies that drive real results. Get a free consultation today.
Get Your Free Strategy Session