Robots.txt Generator
Create a properly formatted robots.txt file in seconds. Control how Googlebot, Bingbot, and other crawlers access your site with User-agent, Allow, Disallow, and Sitemap rules — free, runs in your browser.
Updated July 11, 2026
100% Private & Secure
This tool runs in your browser.
Your data is never uploaded or stored.
How to use
- 1
Configure user-agent rules.
- 2
Set allow and disallow paths.
- 3
Copy or download the generated robots.txt.
When to use it
Blocking staging and dev environments
Prevent crawlers from indexing non-production hosts. A single User-agent: * group with Disallow: / keeps the entire site out of the index, while a separate group lets specific bots through when needed.
Guiding crawl budget on large sites
On sites with millions of URLs (faceted search, parameterized filters), disallowing low-value paths like /search? or /sort= helps Googlebot spend its crawl budget on canonical, indexable pages instead of duplicates.
Declaring your sitemap location
The Sitemap: directive points crawlers at your XML sitemap. It works across hosts — you can list sitemaps on other domains or subdomains, unlike most directives which are host-scoped.
Locking out a misbehaving bot
When a specific crawler is hitting your servers too aggressively, a targeted User-agent: group with Disallow: / tells well-behaved bots to stand down — though rogue scrapers will ignore it.
How it works
What robots.txt actually is — and is not
Robots.txt is a text file at the root of your site (https://example.com/robots.txt) that gives advice to well-behaved crawlers. It is defined by RFC 9309, published in September 2022, which formalized the de-facto protocol Martijn Koster introduced in 1994.
The critical thing to understand: robots.txt is not a security control. It is a cooperative opt-out. It tells Googlebot, Bingbot, and other compliant crawlers which paths to skip — but it cannot stop a scraper that chooses to ignore it. Anything you want truly hidden must sit behind authentication or access control, not in robots.txt.
- RFC 9309 defines only
User-agent,Allow,Disallow, andSitemap— nothing else is standardized - The file is fetched once per crawl session and cached; changes take hours to days to propagate
- A 5xx (server error) response makes Googlebot assume the entire site is off-limits and pause crawling
The wildcard and end-of-path anchor
Two pattern characters extend matching beyond exact paths. * matches any sequence of characters (like a glob), and $ anchors a rule to the end of the URL. Together they let you target URL patterns precisely.
Precedence is most specific wins: a longer match beats a shorter one, and Allow beats Disallow when both match a path equally. This is how you carve out exceptions inside a blocked tree.
User-agent: *
Disallow: /search* # blocks /search, /search?q=x, /search/advanced
Disallow: /*.pdf$ # blocks any URL ending in .pdf
Allow: /search/about$ # but allow exactly /search/about Why crawl-delay is dead — and what to use instead
The Crawl-delay directive was never part of any formal spec. RFC 9309 deliberately omits it because implementations never agreed on what it meant — some treated it as seconds between requests, others as requests per second. Google has never honored it.
If Googlebot is hammering your server, the correct lever is the Crawl Rate setting in Google Search Console (Settings → Crawl stats), not a directive in robots.txt. Bing offers a similar control in Bing Webmaster Tools.
robots.txt Disallow versus the noindex directive
These are commonly confused but do opposite things. Disallow in robots.txt tells crawlers not to fetch a URL — but if other pages link to it, the URL can still appear in results as a bare "uncrawled" entry. The noindex meta tag or HTTP header tells crawlers they may fetch the page but must not index it, which fully removes it from results.
Rule of thumb: if a page must never appear in search, let crawlers fetch it and use noindex. If you need to preserve crawl budget or block access entirely, use Disallow. Never combine them — Disallow hides the page, which means Googlebot never sees your noindex tag and cannot honor it.
Common mistakes & edge cases
Using robots.txt to hide sensitive or private URLs
robots.txt is public and advisory. Disallowed paths are still reachable by anyone, and malicious scrapers specifically scan them. Move private content behind authentication instead.
Crawl-delay: 10 has no effect on Googlebot
RFC 9309 omits crawl-delay and Google has never supported it. To throttle Googlebot, set a custom Crawl Rate in Google Search Console, not a directive in robots.txt.
Combining Disallow with noindex on the same page
Disallow prevents crawling, so Googlebot never reads the noindex tag. To fully de-index a page, allow crawling and rely on noindex alone, or return a noindex X-Robots-Tag HTTP header.
Pattern rules do not match as expected
Remember * matches any run of characters and $ anchors the end. A trailing slash matters: Disallow: /private blocks /private and /private/x, but Disallow: /private/ does not block /private itself.
Frequently Asked Questions
What is robots.txt?
Where do I put the robots.txt file?
How do I block all bots from my site?
How do I allow all bots to crawl everything?
Does robots.txt affect my search ranking?
What is the difference between robots.txt and noindex?
Does Crawl-delay work?
How long until robots.txt changes take effect?
Can I block a specific crawler like GPTBot?
References & further reading
Related reading
Sitemap strategy: what to include and what to leave out
A sitemap is a hint, not a dump. Which URLs belong in it, which actively hurt, and how to keep lastmod honest.
Robots.txt vs noindex: The Right Way to Hide a Page From Google
robots.txt blocks crawling but not indexing; noindex drops a page from the index entirely. Mixing them is the most common SEO mistake on the web.
noindex vs robots.txt vs canonical: when to use which
Three controls that look interchangeable and aren't. A decision table for keeping pages out of Google's index without breaking crawling.