Robots.txt Generator

Create a valid robots.txt file in seconds

What this tool does

What a robots.txt file actually does

A robots.txt file is a set of crawling rules that lives at the root of a domain, typically at /robots.txt. Before a crawler requests any page on your site, it fetches that file first to learn which paths it may and may not request. That is the entire mechanism, and the boundaries matter more than most guides admit.

First, robots.txt governs crawling, not indexing. Blocking a URL in robots.txt stops a crawler from fetching it, which means the crawler cannot see your <meta name="robots" content="noindex"> tag either. This is the single most common misunderstanding: a page blocked by robots.txt is not "hidden from Google", it is simply never read, and if it is already indexed it can stay indexed for months without the URL ever being visited again. Removing the block is what allows a crawler to see a noindex tag or a canonical tag you have added.

Second, robots.txt is not access control. It is a public file that anyone can read, and honouring it is entirely voluntary. It keeps well-behaved crawlers like Googlebot out of directories you do not want crawled, such as staging environments, admin panels, or faceted URL spaces that would otherwise consume crawl budget. It does nothing to stop a determined scraper, which is why robots.txt must never be used to hide sensitive paths.

Third, robots.txt does not pass authority. Blocking a URL removes it from the crawl budget but does not concentrate or transfer link equity the way a canonical tag does. If you are consolidating many variants of a page into one, canonical is the tool for that job, and robots.txt is the tool for keeping crawl traffic off paths you never want visited.

Enter your domain, pick a crawl policy, and this free robots.txt generator writes a ready-to-upload file you can copy straight into /robots.txt on your server. Use it to let search engines index everything, block the whole site, or write custom rules for specific paths and bots.


📋 How to Use

1
Enter domain

Type your site's domain, e.g. yourdomain.com

2
Pick a policy

Allow all, disallow all, or custom rules

3
Copy & upload

Save the file as /robots.txt at your root

Common robots.txt rules

Copy-paste examples for common cases

Each block below is a complete, valid robots.txt file. Replace example.com with your own domain and copy the whole file to the root of your site.

Allow everything

The default when you have nothing to block. Google and Bing treat a missing robots.txt the same way, so this file only documents the intent explicitly.

User-agent: *
Disallow:

Block a single directory

The trailing slash matters: /admin/ blocks the directory and everything under it, while /admin would also block a page named /administrator. Ending the line with a slash is almost always what you want.

User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /checkout/

Block one crawler only

Rules are grouped by user-agent, and the most specific group wins. An empty Disallow: with no value means "allow everything", so this file permits all crawlers except the one named.

User-agent: GPTBot
Disallow: /

User-agent: *
Disallow: /private/

Allow crawling of images while blocking other paths

Note that image links are how Google discovers images, so blocking your image directory can suppress image search traffic for the whole domain. This pattern keeps media crawlable while excluding thin URL spaces.

User-agent: *
Disallow: /*?sort=
Disallow: /*?filter=
Disallow: /search
Allow: /static/media/

Point crawlers at your sitemap

The Sitemap line is not a rule and does not restrict anything, but declaring it helps crawlers find your URLs without crawling the whole site. Supported by Google, Bing, and most major crawlers.

User-agent: *
Disallow:

Sitemap: https://example.com/sitemap.xml

Allow everything (most sites)

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

Block a single directory

User-agent: *
Disallow: /admin/
Disallow: /cart/

Block one crawler only

User-agent: GPTBot
Disallow: /

Robots.txt for AI crawlers — whether you call it a robots.txt generator, a robot txt file generator, or a robots.txt file maker, the file it produces does the same job: it tells crawlers which parts of your site they may request. The file lives at the root of your domain and uses simple User-agent / Allow / Disallow rules. A typical setup lets every bot crawl everything, then adds targeted Disallow rules for private folders such as /admin/ or /cart/.

AI crawlers behave differently from search engines. OpenAI’s GPTBot and Anthropic’s ClaudeBot can be blocked with their own User-agent lines, while Google-Extended controls whether your content is used to train AI models without affecting normal Google Search crawling:

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

Keep the file minimal, always add a Sitemap line, and test it before going live. This generator supports allow-all, block-all and custom policies and returns the finished file ready to copy to your server.

FAQ

Mistakes that break a robots.txt file

Most robots.txt problems are not subtle syntax errors; they are a handful of recurring mistakes that either fail silently or do the opposite of what was intended.

An empty Disallow line allows everything, it does not block nothing

Disallow: with nothing after the colon is interpreted as "crawl everything". Deleting the whole line produces the identical result, so an empty value adds nothing but confusion. To block a site entirely you need Disallow: /.

User-agent names are matched case-insensitively, but must be exact

Googlebot, googlebot, and GoogleBot all match, but google-bot or googlebot/2.1 do not, because user-agent tokens match on a prefix of the crawler's own product token.

One directive per line, no line continuations

A rule cannot wrap across lines. A long Disallow path must be a single unbroken line, and XML comments (<!-- -->) are not part of the de-facto standard even though many parsers accept them.

robots.txt lives at the domain root only

A robots.txt placed in a subdirectory is ignored. There is exactly one per scheme and host, so https://example.com/robots.txt governs https://example.com/ and http://example.com/robots.txt governs the http version separately.

Blocking a page does not remove it from the index

If a URL is already indexed, disallowing it in robots.txt cannot trigger deindexing, because the crawler can no longer fetch the page to see the noindex tag. Use the noindex tag while the page is still crawlable, then optionally block it once it is out of the index.

Case sensitivity in paths

Paths are matched with case sensitivity on most crawlers. /Admin/ and /admin/ are different rules, and on Windows-hosted origins the filesystem may not agree with either. Match the exact casing of your URLs.

What is robots.txt?

It is a plain text file at the root of your site that tells search engine crawlers which pages they may or may not request. It is a crawling instruction, not a security measure — never use it to hide private data.

Does robots.txt remove pages from Google?

No. To keep a page out of search results you need a noindex tag or the URL Removal tool. A Disallow rule only stops crawling, and can even prevent Google from seeing a noindex tag.

Where does robots.txt go?

At the root of the domain: https://yourdomain.com/robots.txt. It only applies to that exact host, not subdomains.

Does robots.txt affect rankings?

The file itself is not a ranking factor, but blocking the wrong URLs can stop Google from crawling pages you want indexed — which indirectly hurts visibility. Keep it minimal and test with the robots.txt Tester.

Is this robots.txt generator free?

Yes. It runs entirely in your browser, requires no signup, and the file it produces is standards-compliant and ready to upload.

Related tools