🤖 Robots.txt Generator — Free Online
Build a correct robots.txt with user-agent rules, allow/disallow paths and a sitemap line. Copy-paste examples for WordPress and Shopify.
Assemble User-agent rules, allows, disallows, and the sitemap pointer — validated and downloadable.
How to use robots.txt generator
- Add rules per crawler.
- Set sitemap URL.
- Download robots.txt.
What robots.txt is for
robots.txt tells crawlers which paths they may request. It is a crawl instruction, not access control: anyone can read the file, and a disallowed page can still appear in search results if other sites link to it. Never put secrets in robots.txt.
The file must live at the domain root — https://example.com/robots.txt. A copy in a subdirectory is ignored.
Directives you actually need
| Directive | Example | Notes |
|---|---|---|
| User-agent | User-agent: * | One block per crawler; * means all |
| Disallow | Disallow: /admin/ | Blocks crawling of a path |
| Allow | Allow: /admin/public/ | Exception; the longest matching rule wins |
| Sitemap | Sitemap: https://example.com/sitemap.xml | Absolute URL; not a crawl rule |
| Crawl-delay | Crawl-delay: 10 | Ignored by Google; use Search Console instead |
Copy-paste examples
WordPress
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /?s=
Disallow: /search/
Sitemap: https://example.com/sitemap.xmlShopify
User-agent: *
Disallow: /cart
Disallow: /checkout
Disallow: /orders
Disallow: /account
Disallow: /*?*sort_by=
Disallow: /*?*filter=
Sitemap: https://example.com/sitemap.xmlSmall static site
User-agent: *
Allow: /
Disallow: /private/
Sitemap: https://example.com/sitemap.xmlThese are starting points. Test against your real URL structure before deploying, and never block CSS or JavaScript that Google needs to render a page.
robots.txt vs noindex
robots.txt prevents crawling; a noindex meta tag prevents indexing. If you disallow a page, Google cannot see its noindex tag, so the page can stay indexed without a snippet. To remove an already-indexed page, allow crawling first, add noindex, then remove the Disallow after the page drops out.
Test before you deploy
- Open Search Console → Settings → robots.txt to see the live file and test a URL.
- Check for an accidental Disallow: / — that blocks the whole site.
- Make sure the sitemap URL returns 200 and is absolute.
- Keep a backup so you can roll back in one step.
- Remember that robots.txt is public: it reveals paths, not secrets.
Sitemap generatorCanonical URL generatorRedirect generatorSEO tools
Features
- Multi-agent rules
- Allow/disallow lists
- Sitemap line
- Download + copy
Privacy
This tool runs entirely in your browser. Your files and text stay on your device — nothing is uploaded, and nothing is sent to analytics. Privacy policy
How this tool is tested
This page is the real tool, not a screenshot: it runs locally in your browser and is verified in current Chrome, Edge, Firefox, and Safari before each release. Your input stays on your device for supported tasks.
By Mccowns.com team · Reviewed
Frequently asked questions
Does robots.txt block hackers?
No — it is advisory. Sensitive paths need authentication, not disallow lines.
Where does it live?
Domain root: example.com/robots.txt. Subdirectory copies are ignored.
Private?
Yes.