Skip to content

Robots.txt Generator

RFC 9309 rules builder Saved locally

1 · Rule groups

2 · Sitemaps & extras

Verdict for every major crawler against the same path:

Free forever Runs 100% in your browser RFC 9309 compliant

Robots.txt
Generator

Write crawler rules without memorizing syntax. Build Allow and Disallow groups for Googlebot, Bingbot and AI crawlers like GPTBot — then export a clean, standards-compliant file in one click.

No signup Nothing sent to a server AI crawler presets
The basics

One small text file that steers every crawler

robots.txt is a plain-text file at your domain root that tells web crawlers which paths they may request. Standardized as RFC 9309 in 2022, the Robots Exclusion Protocol has governed crawler traffic since 1994 — every major search engine and most AI crawlers check it before fetching a single page.

  • Lives at the root only. It must answer at https://yourdomain.com/robots.txt — one file per host and protocol.

  • Advisory, not security. Honest bots obey it; anyone can read it. Never list paths you actually need to keep secret.

  • Google parses the first 500 KB. Anything past that limit is ignored — keep rules compact and use wildcards.

  • Crawl control, not index control. Disallow stops fetching; it does not guarantee a URL stays out of search results.

https://example.com/robots.txt
200 OK
User-agent: *
Disallow: /tmp/
Disallow: /search?
Allow: /public/

User-agent: Googlebot-Image
Disallow: /

Sitemap: https://example.com/sitemap.xml
3
rule groups
5
path rules
1
sitemap line
Syntax

Six directives run the whole file

Everything a robots.txt can say fits into a handful of instructions. Master these and you can write rules for any crawler on the web.

User-agent All crawlers

Opens a rule group and names the crawler it applies to. Use * for every bot. A specific token like Googlebot always beats the wildcard — and once a bot matches its own group, it ignores every other group in the file.

User-agent: Googlebot
Disallow All crawlers

Blocks matching paths from being crawled. Matching is prefix-based and case-sensitive, so /Admin/ is not /admin/. An empty Disallow: line is the standard way to say "crawl everything".

Disallow: /checkout/
Allow Google, Bing, RFC 9309

Carves exceptions out of a broader Disallow. When an Allow and a Disallow tie on length, Allow wins. Use it to expose one file inside a blocked folder — for example Allow: /docs/guide.pdf under Disallow: /docs/.

Allow: /public/
Sitemap Google, Bing, Yandex

Points crawlers at your XML sitemap. It must be an absolute URL and it sits outside any User-agent group, so you can place it anywhere — convention is the last line. You may list several sitemaps, one per line.

Sitemap: https://example.com/sitemap.xml
Crawl-delay Bing, Yandex — ignored by Google

Asks polite crawlers to wait N seconds between requests. Googlebot ignores it entirely (throttle Google in Search Console instead), but Bing and Yandex honor it. Handy on shared hosting when aggressive bots eat your CPU.

Crawl-delay: 10
Wildcards: * and $ Google, Bing, RFC 9309

* matches any run of characters and $ anchors the pattern to the end of the URL. Together they enable pattern rules like Disallow: /*?*sessionid= or Disallow: /*.pdf$ without listing every path by hand.

Disallow: /*.pdf$
Rule engine

How crawlers decide what wins

Two simple precedence rules govern every robots.txt — understand them and conflicting lines stop being scary.

Longest match wins

When several rules match one URL, the crawler applies the rule with the longest path. Here the page stays crawlable even though its folder is blocked.

User-agent: *
Disallow: /blog/
Allow: /blog/robots-txt-guide
/blog/robots-txt-guide → crawled (Allow is longer)

Named groups beat the wildcard

A bot that finds its own User-agent group follows only that group — the * section is ignored completely. Googlebot-specific rules never leak into Bingbot behavior.

User-agent: * fallback for unmatched bots
User-agent: Googlebot Googlebot reads only this

Tie-breaker: if Allow and Disallow match with equal length, Allow wins.

User-agent: * · Disallow: /

Blocks the entire site from every bot — the classic launch-day disaster.

User-agent: * · Disallow:

An empty Disallow means allow everything — the polite, explicit default.

Pitfalls

Four mistakes that silently hurt sites

robots.txt errors rarely throw errors — they just quietly drain rankings. Check yours against this list.

1

Blocking CSS and JavaScript

If Googlebot cannot fetch your stylesheets and scripts, it cannot render the page — and rendered pages are what rankings are based on. Never disallow /assets/, /static/ or /wp-includes/ without checking what lives there.

2

Using robots.txt to hide pages from search

Disallow stops crawling, not indexing. A blocked URL can still appear in results as a bare link if other pages point to it. To keep a page out of the index, let it be crawled and use a noindex meta tag or X-Robots-Tag header instead.

3

Placing the file in the wrong location

robots.txt only works at the root of the exact host and protocol — https://example.com/robots.txt. A file in /blog/robots.txt, on a different subdomain, or behind a redirect chain is simply invisible to crawlers.

4

Treating it as a security control

The file is advisory and publicly readable. Respectful bots obey it; scrapers and malware do not — and listing /admin-backup/ advertises its existence. Real protection needs authentication, not a Disallow line.

Toolbox

robots.txt vs meta robots vs X-Robots-Tag

Three different levers for three different jobs. Most sites need all of them eventually — here is when to pull which.

robots.txt meta robots X-Robots-Tag
Where it lives Site root file HTML <head> HTTP response header
Controls crawling Yes No — page must be crawled No — page must be crawled
Controls indexing Not reliably Yes (noindex) Yes (noindex)
Works on files (PDF, images) Yes HTML only Yes — any response
Best for Crawl budget, faceted URLs, AI bots Per-page noindex, nofollow Non-HTML assets, staging hosts

Rule of thumb: robots.txt manages the crawl queue; meta robots and X-Robots-Tag manage the index.

Workflow

From blank file to deployed in four steps

The generator handles formatting, ordering and edge cases — you make the policy decisions.

  1. 1

    Choose a starting preset

    Begin with "allow everything", a CMS template, or the AI-crawler preset — then shape it to your site. Presets cover WordPress, Shopify and static-site conventions.

  2. 2

    Add rule groups per bot

    Create a User-agent group for each crawler you want to treat differently — Googlebot, GPTBot, ClaudeBot — then attach Allow and Disallow paths. Wildcards and the $ anchor are built in.

  3. 3

    Set crawl-delay and sitemaps

    Optionally slow down polite bots on small servers, and declare one or more absolute sitemap URLs so every crawler finds your freshest URLs first.

  4. 4

    Copy, download, deploy at the root

    Grab the generated text, upload it as robots.txt to your domain root, and verify it returns 200 at /robots.txt. Then test key URLs with our Robots.txt Tester.

FAQ

Robots.txt questions, answered

The details that trip up even experienced developers.

Is robots.txt required for SEO?

No. Search engines will crawl and index your site without one. But a well-formed robots.txt helps you spend crawl budget on the URLs that matter, keeps faceted and duplicate URLs out of the crawl queue, and tells crawlers where your XML sitemap lives — all of which support better, faster indexing.

What is the difference between Disallow and noindex?

Disallow in robots.txt prevents crawling; noindex (a meta tag or X-Robots-Tag header) prevents indexing. They solve different problems and should not be combined on the same URL — if a page is disallowed, Google can never crawl it to see the noindex, so the URL may remain in results as a link-only entry.

Which rule wins when Allow and Disallow conflict?

Per RFC 9309, the longest matching path wins. So Allow: /blog/guide (12 chars) beats Disallow: /blog/ (6 chars) for that URL. If both match with identical length, Allow wins the tie-break.

Does robots.txt work on subdomains and HTTP/HTTPS?

Each host+protocol pair is treated separately. https://example.com and http://example.com each need their own file, as does blog.example.com. If a crawler cannot fetch the file after a few redirects or a 5xx error, it assumes everything is allowed — or, on persistent server errors, that everything is disallowed.

How big can a robots.txt file be?

Google only parses the first 500 KB of the file and ignores everything beyond it. Keep rules consolidated with wildcards rather than listing thousands of individual paths.

Can I block AI crawlers like GPTBot with this file?

Yes — the generator supports dedicated rule groups for GPTBot, ClaudeBot, PerplexityBot, Google-Extended and other AI user-agents. For fine-grained control across training crawlers versus answer-engine bots, pair this with our AI Crawler Robots.txt Rules tool.

Your crawlers are waiting for instructions

A five-line file decides whether bots spend their budget on your best pages or your filter parameters. Write it once — write it right.