🤖

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.

Configuration
Generated robots.txt

How to use

  1. 1

    Configure user-agent rules.

  2. 2

    Set allow and disallow paths.

  3. 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, and Sitemap — 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

Problem

Using robots.txt to hide sensitive or private URLs

Fix

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.

Problem

Crawl-delay: 10 has no effect on Googlebot

Fix

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.

Problem

Combining Disallow with noindex on the same page

Fix

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.

Problem

Pattern rules do not match as expected

Fix

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?
Robots.txt is a plain-text file placed at the root of your site (for example, example.com/robots.txt) that tells search-engine crawlers which pages they may or may not crawl. It follows the Robots Exclusion Protocol defined in RFC 9309.
Where do I put the robots.txt file?
It must live at the root of your domain and be reachable at /robots.txt — for example https://www.example.com/robots.txt. It only controls paths on that exact host; a file on a subdomain does not affect the main domain.
How do I block all bots from my site?
Use a single rule group that targets every crawler: "User-agent: *" followed by "Disallow: /". This asks all well-behaved bots, including Googlebot and Bingbot, to stay away from the entire site.
How do I allow all bots to crawl everything?
Either publish an empty robots.txt file, or use "User-agent: *" with "Disallow:" (no value). Both signal that nothing is blocked.
Does robots.txt affect my search ranking?
Not directly. Robots.txt controls crawling, not ranking. However, blocking important pages with Disallow prevents Google from indexing them, which removes them from search results. Use it to guide crawl budget, not to boost rankings.
What is the difference between robots.txt and noindex?
Disallow in robots.txt stops crawlers from fetching a page; noindex (a meta tag or HTTP header) lets them fetch it but forbids indexing. If a page must never appear in search, allow crawling and use noindex — because Disallow hides the page, Googlebot never sees your noindex instruction.
Does Crawl-delay work?
No, not for Google. RFC 9309 omits Crawl-delay and Google has never honored it. To slow Googlebot down, set a custom Crawl Rate in Google Search Console instead of putting a directive in robots.txt.
How long until robots.txt changes take effect?
Crawlers cache robots.txt for up to 24 hours, so most changes are picked up within a day. During heavy crawl periods it can take several days for every rule to propagate fully.
Can I block a specific crawler like GPTBot?
Yes. Add a dedicated group, for example "User-agent: GPTBot" followed by "Disallow: /", to ask that single bot to stop crawling. Well-behaved AI and search bots each declare their own user-agent name you can target.

References & further reading

Related reading

Related Tools

View all tools