Skip to content
ToolZone

Robots.txt Generator

Create a properly formatted robots.txt file, telling search engine crawlers exactly which parts of your site they can and cannot access.

Runs in your browser. Nothing you enter or upload leaves your device.

Start from a template
User-agent: *
Disallow: /admin/
Disallow: /private/
Disallow: /cart/
Disallow: /checkout/

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

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Robots.txt Generator

A robots.txt file tells crawlers which parts of your site they may visit. This Robots.txt Generator starts from a template, such as WordPress or blocking AI crawlers, lets you set rules for each crawler, and writes a clean file you can copy or download.

How it works

The file starts with a User-agent line using the value you enter; * means the rules apply to all crawlers. Each non-empty line in the Allow box becomes an Allow: line, followed by each non-empty line in the Disallow box as a Disallow: line.

If a sitemap URL is entered, a blank line and a Sitemap: line are added at the end. The tool starts with sensible example values, disallowing /admin/ and /private/ for all user-agents and listing an example sitemap, which you can edit or clear.

How to use

  1. 1

    Pick a template to start from.

  2. 2

    Adjust the User-agent, Allow and Disallow paths, or add groups for other crawlers.

  3. 3

    Enter your Sitemap URLs.

  4. 4

    Copy or download the file and save it as robots.txt in your site's root folder. Copy link saves the draft with all its rules.

Worked examples

The default setup

Blocking admin and private folders for all crawlers.

Input
User-agent: * Disallow: /admin/, /private/ Sitemap: https://example.com/sitemap.xml
Result
User-agent: * Disallow: /admin/ Disallow: /private/ Sitemap: https://example.com/sitemap.xml

Block a folder but allow one file in it

A WordPress site that blocks wp-admin but needs admin-ajax.php reachable.

Input
User-agent: * Allow: /wp-admin/admin-ajax.php Disallow: /wp-admin/ Sitemap: https://example.com/sitemap_index.xml
Result
User-agent: * Allow: /wp-admin/admin-ajax.php Disallow: /wp-admin/ Sitemap: https://example.com/sitemap_index.xml

Google applies the most specific matching rule, so the longer Allow path wins for that one file.

Limitations
robots.txt is a request, not access control; it doesn't hide pages from people or badly behaved bots. Google ignores Crawl-delay. The AI crawler list covers well-known bots and may need updating as new ones appear.
Assumptions
The file will be served at the root of the domain, such as https://example.com/robots.txt. Crawlers follow the Robots Exclusion Protocol, as major search engines do.
Privacy
The file is generated in your browser; nothing you type is sent or stored.

Frequently asked questions

Where does robots.txt need to be placed?+

At the root of your domain, for example https://yoursite.com/robots.txt. Crawlers do not look for it in subfolders, and each subdomain needs its own file.

Does robots.txt prevent a page from appearing in search results?+

Not necessarily. It blocks crawling, but a blocked URL can still be indexed if it is linked from elsewhere. Use a noindex meta tag to keep a page out of results.

What does User-agent: * mean?+

The asterisk applies the rules to all crawlers. Enter a specific name, such as Googlebot or Bingbot, to target one bot.

Should I add my sitemap to robots.txt?+

Yes. A Sitemap line helps all search engines find your sitemap, even ones where you have not submitted it manually.

What if both Allow and Disallow match a URL?+

Google and Bing apply the most specific rule, meaning the one with the longest matching path. If they are equally specific, Allow wins.

Related tools