SEO Tool

Robots.txt Generator

Generate a clean starter robots.txt with user-agent, allow, disallow, and sitemap rules for common SEO setups.

Tool area

Everything runs in the browser.

Use this robots.txt generator when you need a readable draft for a launch, migration, staging environment, or client handoff. It keeps the common syntax tidy, but it still expects you to review the rules before uploading them because robots.txt can affect how search engines crawl important sections of a site.

  • Do not block CSS, JavaScript, or important content unless you are sure.
  • Use noindex meta tags for indexing decisions; robots.txt mainly controls crawling.
  • Add the sitemap line when you want crawlers to discover your XML sitemap faster.

How to use

  1. Choose the user-agent, usually * for a broad rule.
  2. Add allow, disallow, and sitemap values only where they are needed.
  3. Copy the generated robots.txt output and test it before deployment.

Common use cases

  • Draft a starter robots.txt file for a new site.
  • Prepare crawl-control examples for clients, staging sites, or migrations.
  • Avoid basic formatting mistakes when adding sitemap or disallow rules.

Build and check a minimal file

Save the file at the host root, for example https://example.com/robots.txt. The asterisk addresses all crawlers that follow the protocol. This sample asks them to skip URLs starting with /preview/. Use your actual sitemap address and check that the file is publicly readable.

# Site rules
User-agent: *
Disallow: /preview/
Sitemap: https://example.com/sitemap.xml

Three paths to test before replacing robots.txt

Start with the example rule Disallow: /preview/. Compare these paths against the entire prefix, including the trailing slash.

CaseResult
/preview/42Blocked
/previewAllowed
/preview-2/Allowed

Repeat the check for pages and CSS and JavaScript files that should stay accessible. A Disallow: / rule blocks every path for the affected group unless a more specific exception applies.

FAQ

Does it cover advanced robots rules?

No. It is designed for common starter patterns, not every advanced directive.

Does blocking crawling remove a page from search?

A blocked URL can still appear in results. Allow Google to crawl a page so it can read a noindex directive. Use authentication for private content.

Can I leave some fields empty?

Yes. Empty fields are skipped from the output.

Related tools

Browse all seo tools

Related guides

Previous tool Robots Meta Tag Generator