Developer tool

Robots.txt Generator

Choose crawler rules and optionally enter a sitemap URL to create a plain-text draft.

Runs in your browser. No upload.

Values are processed locally in this browser.

Result

—

About this tool

Robots.txt Generator made simple.

Robots.txt is a crawl directive, not access control. Do not use it to protect private files; verify syntax and intended paths before publishing.

Guide

Using Robots.txt Generator

The Robots.txt Generator writes the text of a robots.txt file from a few boxes: one crawler name, the paths it may fetch, the paths it should skip, and an optional sitemap address. You get a plain-text draft to copy into a file on your own site. It makes one rule group at a time and does not test your site, so read the result before you publish it.

How to use it

  1. Type one crawler name in the User-agent box. It starts with an asterisk, which means every crawler. Use a name such as Googlebot to address one bot only.
  2. Type paths in the Allow box and the Disallow box, one per line. Each path must begin with a slash and contain no spaces. Leave a box empty if you have nothing for it.
  3. Add a full sitemap address starting with http or https if you want one in the file. Press Calculate to build the text.
  4. Press Copy result and paste it into a plain text file named robots.txt at the top level of your site. Use Clear to start over.

Worked examples

Hide two folders from every crawler

You enter
User agent
*
Allow
Disallow
/admin/ /tmp/
Sitemap
https://example.com/sitemap.xml
You get
File
User-agent: * Disallow: /admin/ Disallow: /tmp/ Sitemap: https://example.com/sitemap.xml

The tool writes the user-agent line, then one line per disallowed path in the order you typed them, then a blank line and the sitemap line. Every path starts with a slash, as the tool requires.

Run through the tool’s own code.

One bot with an allowed exception

You enter
User agent
Googlebot
Allow
/public/
Disallow
/private/
Sitemap
You get
File
User-agent: Googlebot Allow: /public/ Disallow: /private/

Allow lines are written before Disallow lines. The rule set applies to the named crawler only. Other crawlers will see no group for them in this file.

Run through the tool’s own code.

Block everything

You enter
User agent
*
Allow
Disallow
/
Sitemap
You get
File
User-agent: * Disallow: /

A single slash covers the whole site, so compliant crawlers are asked not to fetch anything. If you leave Disallow empty instead, the file is only the user-agent line, which places no limits.

Run through the tool’s own code.

When it helps

  • Draft a first robots.txt for a new site before you hand it to a developer.
  • Ask crawlers to skip admin pages, search results or temporary folders to reduce needless requests.
  • Add a sitemap line so crawlers can find your list of pages.
  • Learn the format by changing the boxes and watching how each line is written.

Limits to keep in mind

  • It builds one group for one user-agent name, up to 100 characters with no line breaks. For several bots, make one block for each, then join them by hand with a blank line between.
  • Each path must start with a slash, have no spaces and be at most 500 characters. A path like admin without the slash is rejected, and the sitemap must be a complete http or https address without a login in it.
  • It writes only user-agent, allow, disallow and sitemap lines. There is no crawl-delay, no comments, and no check against your real pages, so a typo in a path is not caught.
  • Robots.txt is a request to well-behaved crawlers, not a lock. Anyone can read the file and ignore it, so never use it to hide private files.

Tips

  • Before you publish, read the generated lines once and ask whether each path is exactly what you meant to block.
  • To keep a page out of search results, a noindex tag or a password is the right tool, not a disallow rule.
  • Place the file at the top level of the site, so a visitor can open it at your domain followed by /robots.txt, and keep it short and easy to read.

Sources

Common questions

About Robots.txt Generator.

Where do I put the robots.txt file?

It must sit at the top-level path of your site, so the address ends in /robots.txt. The standard says the file is plain text encoded in UTF-8. Create a text file with that name, paste the generated lines in it and upload it to your site's root.

Does a disallow line make a page private?

No. Robots.txt is not access control. The standard warns that it is no substitute for real content security, and that listing a path in the file makes it easy to discover. Protect private pages with a login or other access rules.

Will blocking a page remove it from Google?

Not reliably. Google says robots.txt is used mainly to manage crawling traffic and is not a way to keep a page out of Google. To keep a page out of search results, use a noindex tag or protect the page with a password.

What happens if Allow and Disallow overlap?

Under the standard, the rule that matches the most characters of the path is the one used, so a longer, more specific Allow can override a shorter Disallow. The order of the lines does not decide it. The tool writes Allow lines first, then Disallow lines.

What happens if I leave both path boxes empty?

The output is only the user-agent line, with the sitemap line if you gave one. That puts no limits on the named crawler, which is the same as having no rules for it.

Why was my path or sitemap rejected?

A path has to start with a slash and have no spaces, so write /admin/ and not admin. The sitemap must be a full address that starts with http or https, with no username or password, so write https://example.com/sitemap.xml.

Is my input sent anywhere?

No. The page says values are processed locally in your browser, and the page does not upload your input.

How do I use Robots.txt generator?

Choose crawler rules and optionally enter a sitemap URL to create a plain-text draft.

Is my data uploaded to a server?

No. This tool runs locally in your browser. Your input is not uploaded.