🤖 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.

Your files stay on your device. This tool processes PDFs locally in your browser whenever the tool supports it — no uploads, no account. Privacy policy

Assemble User-agent rules, allows, disallows, and the sitemap pointer — validated and downloadable.

How to use robots.txt generator

  1. Add rules per crawler.
  2. Set sitemap URL.
  3. 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

DirectiveExampleNotes
User-agentUser-agent: *One block per crawler; * means all
DisallowDisallow: /admin/Blocks crawling of a path
AllowAllow: /admin/public/Exception; the longest matching rule wins
SitemapSitemap: https://example.com/sitemap.xmlAbsolute URL; not a crawl rule
Crawl-delayCrawl-delay: 10Ignored 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.xml

Shopify

User-agent: *
Disallow: /cart
Disallow: /checkout
Disallow: /orders
Disallow: /account
Disallow: /*?*sort_by=
Disallow: /*?*filter=
Sitemap: https://example.com/sitemap.xml

Small static site

User-agent: *
Allow: /
Disallow: /private/
Sitemap: https://example.com/sitemap.xml

These 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.

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.

Related seo tools