SEO Tools

Robots.txt Generator

Use this free Robots.txt Generator to build a correctly formatted robots.txt file without writing a line of syntax. Set crawl rules, add your sitemap, control AI training crawlers, and copy a file that is ready to upload to your site root. No sign-up required.

Valid Syntax AI Crawler Control 100% Free

Configuration

Optional: Time between requests

Preview

User-agent: *
Allow: /

Why You Are Here

A robots.txt file is four or five lines of plain text, and getting it wrong can remove your entire site from search results. One misplaced slash is the difference between blocking an admin folder and blocking everything you have ever published.

That asymmetry is the whole reason to use a generator. The syntax is not complicated, but it is unforgiving, and there is no error message when you get it wrong. The file simply does something other than what you intended, quietly, until someone notices the traffic has gone.

The first situation is setting up a new site. You need a working robots.txt, you want the sitemap directive in the right format, and you would rather not learn the Robots Exclusion Protocol from scratch to write five lines.

The second is stopping crawl waste. Your site generates URLs nobody should be crawling: filtered product listings, internal search results, session parameters, staging paths. Every request a crawler spends there is one it does not spend on pages that matter.

The third is increasingly common: controlling AI crawlers. Language model training crawlers and AI search agents now visit most sites, and robots.txt is currently the main mechanism site owners have for saying yes or no to them.

What This Tool Does

The Robots.txt Generator gives you form controls for each directive and builds correctly formatted output as you work.

Set your default rule, add paths you want to allow or disallow, choose which crawlers each rule applies to, add your sitemap URL, and optionally block AI training crawlers. The generated file appears ready to copy or download.

Everything runs in your browser. Nothing is uploaded or stored.

The Most Important Thing to Understand

robots.txt controls crawling. It does not control indexing.

These are different things, and confusing them causes real damage. Disallow tells a crawler not to FETCH a page. It does not tell a search engine not to LIST it. If other sites link to a URL you have disallowed, Google can still index that URL and show it in results, typically as a bare link with no description and a note that no information is available.

The trap is worse than it first appears. If you want a page removed from search results, the correct tool is a noindex meta tag or X-Robots-Tag header. But a crawler has to FETCH the page to see that tag. If you have disallowed the page in robots.txt, the crawler never fetches it, never sees the noindex, and the page stays indexed indefinitely.

The correct sequence for removing a page from search

  1. Allow crawling of the page in robots.txt
  2. Add noindex to the page
  3. Wait for the search engine to recrawl and drop it
  4. Only then disallow it in robots.txt, if you still want to save crawl budget
Use Disallow to save crawl budget on pages you do not care about. Use noindex to keep pages out of search results. They are not interchangeable.

robots.txt Directive Reference

Directive

Purpose

Google Support

User-agent

Names which crawler the following rules apply to

Yes

Disallow

Blocks crawling of a path

Yes

Allow

Permits a path inside a disallowed directory

Yes

Sitemap

Points to your XML sitemap, full URL required

Yes

Crawl-delay

Requests a pause between requests

NO — ignored

Noindex

Was never officially supported

NO — removed 2019

Host

Preferred domain

No

* wildcard

Matches any sequence of characters

Yes

$ end anchor

Matches the end of a URL

Yes

Google ignores Crawl-delay completely

It always has. Bing and Yandex honour it. If Googlebot is overloading your server, adjust the crawl rate in Search Console or return 503 responses. The directive will do nothing. A great deal of published advice still recommends it without this caveat.

Noindex in robots.txt stopped working on 1 September 2019

Google formally removed support for it. If you have inherited a file containing Noindex: lines, they are doing nothing, and the pages they reference may well be indexed.

How Rule Matching Works

When several rules could apply to one URL, Google uses the MOST SPECIFIC rule, measured by the length of the path. If two rules are the same length, the LEAST RESTRICTIVE one wins, meaning Allow beats Disallow.

User-agent: *

Disallow: /blog/

Allow: /blog/public/


# /blog/public/post matches both rules.

# The Allow path is longer, so it wins.

# The page is crawlable.

Wildcards

Disallow: /*?sort=          # any URL containing ?sort=

Disallow: /*.pdf$           # any URL ending in .pdf

Disallow: /private*/        # /private1/, /private-docs/, etc.


# * matches any sequence of characters

# $ anchors to the end of the URL

# Both are Google extensions rather than part of the original

# standard, though all major search engines now support them.

AI Crawler Reference

AI companies operate crawlers for training data, retrieval, and user-initiated browsing. Most publish a user-agent token you can target in robots.txt. Blocking is voluntary compliance rather than technical enforcement, but the major operators do honour it.

User-agent

Operator

Purpose

GPTBot

OpenAI

Model training

OAI-SearchBot

OpenAI

Search indexing

ChatGPT-User

OpenAI

User-initiated fetches

ClaudeBot

Anthropic

Model training

Google-Extended

Google

Gemini training, separate from Search

Applebot-Extended

Apple

Apple AI training

PerplexityBot

Perplexity

Search indexing

CCBot

Common Crawl

Open crawl dataset

Bytespider

ByteDance

Model training

meta-externalagent

Meta

Model training

To block AI training crawlers while keeping search crawlers

User-agent: GPTBot

Disallow: /


User-agent: ClaudeBot

Disallow: /


User-agent: Google-Extended

Disallow: /


User-agent: CCBot

Disallow: /


User-agent: *

Allow: /
Two things worth knowing. Google-Extended controls Gemini training only. It does NOT affect Google Search crawling or ranking, so blocking it costs you nothing in search visibility. And user-agent tokens change as operators launch and rename crawlers, so this list is worth revisiting periodically rather than treating as permanent.

Common Configuration Examples

Standard site, allow everything

User-agent: *

Disallow:


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


# An empty Disallow means nothing is blocked.

# This is the safe default.

WordPress


User-agent: *

Disallow: /wp-admin/

Allow: /wp-admin/admin-ajax.php


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


# admin-ajax.php must stay crawlable. Many themes and

# plugins rely on it to render pages correctly.

Ecommerce, reducing crawl waste

User-agent: *

Disallow: /cart

Disallow: /checkout

Disallow: /*?sort=

Disallow: /*?filter=

Disallow: /search


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


# Faceted navigation can generate thousands of near-identical

# URLs. This is where crawl budget usually leaks.

Staging site, block everything

User-agent: *

Disallow: /


# This blocks the entire site. Never deploy it to production.

# Adding HTTP authentication to staging is more reliable,

# since robots.txt depends on crawler cooperation.

File Requirements

Requirement

Detail

Location

Root of the host: https://example.com/robots.txt

Filename

Exactly robots.txt, all lowercase

Format

Plain text, UTF-8

Response code

Must return 200

Size limit

Google reads the first 500 KiB

Scope

Per protocol, host, and port

Subdomain scoping causes more confusion than any other rule

A robots.txt at example.com does NOT apply to blog.example.com, shop.example.com, or www.example.com if those resolve separately. Each host needs its own file.

If robots.txt returns 404, crawlers treat the site as fully crawlable. If it returns a 5xx error, Google may temporarily treat the whole site as disallowed, which means a server problem on that one file can pause crawling site-wide.

Common Mistakes to Avoid

Disallowing a Page to Remove It From Search Results

This is the most damaging robots.txt mistake and it is extremely common. Blocking a URL stops it being crawled, not listed. Worse, if the page already carries a noindex tag, disallowing it means the crawler can never fetch the page to see that tag, so the page stays in the index permanently. To remove a page: allow crawling, add noindex, wait for recrawl, and only disallow afterwards if you want to save crawl budget.
Blocking CSS and JavaScript

Blocking /assets/, /wp-content/themes/, or /wp-content/plugins/ was standard advice a decade ago and is actively harmful now. Google renders pages the way a browser does, and it needs your stylesheets and scripts to do that. Block them and Google sees a broken, unstyled page, which affects how it assesses layout, mobile usability, and content. Leave asset directories crawlable.
Listing Sensitive Paths in a Public File

Anyone can read yourdomain.com/robots.txt. Writing Disallow: /admin-backup-2024/ publishes the exact location of something you wanted hidden, and attackers routinely check robots.txt for precisely this. Protect sensitive areas with authentication or server rules. If something must not be found, its path does not belong in a public text file.

Quick Reference

Item

Detail

Location

Site root, lowercase filename

Disallow

Blocks crawling, not indexing

To deindex

Use noindex, keep crawlable

Crawl-delay

Google ignores it

Noindex: in robots.txt

Dead since 2019

Rule precedence

Longest matching rule wins

Tie-break

Allow beats Disallow

Subdomains

Need their own file

Missing file

Means crawl everything

Size limit

500 KiB

Never block

CSS or JS

Privacy

The file is publicly readable

Frequently Asked Questions

What is a robots.txt generator?

A robots.txt generator is a free online tool that builds a correctly formatted robots.txt file from simple form inputs, so you do not have to write the syntax yourself. You choose which paths to allow or block, which crawlers the rules apply to, and add your sitemap. This Robots.txt Generator produces a valid file ready to upload to your site root.

Does robots.txt stop pages from appearing in Google?

No, and this is the most common misunderstanding about the file. Disallow prevents crawling, not indexing. If other sites link to a blocked URL, Google can still list it in search results, usually without a description. To keep a page out of results you need a noindex meta tag, and the page must remain crawlable so Google can actually see that tag.

Where does the robots.txt file go?

In the root directory of your domain, so it is reachable at https://yourdomain.com/robots.txt. The filename must be exactly robots.txt in lowercase. It only applies to the exact protocol, host, and port it sits on, so subdomains such as blog.yourdomain.com need their own separate file.

How do I block ChatGPT and other AI crawlers?

Add a User-agent block for each AI crawler followed by Disallow: /. The main tokens are GPTBot and OAI-SearchBot for OpenAI, ClaudeBot for Anthropic, Google-Extended for Gemini training, CCBot for Common Crawl, and PerplexityBot for Perplexity. Blocking Google-Extended does not affect Google Search rankings, since that token covers AI training only.

Does Google respect crawl-delay?

No. Google has never supported the Crawl-delay directive and ignores it entirely, despite a great deal of published advice suggesting otherwise. Bing and Yandex do honour it. If Googlebot is putting too much load on your server, adjust the crawl rate through Google Search Console instead.

What happens if I do not have a robots.txt file?

Crawlers treat the absence of the file as permission to crawl everything, so your site will be crawled normally. A missing robots.txt is not an SEO problem in itself. It becomes worth adding when you have paths you want to keep crawlers away from, or when you want to declare your sitemap location.

How do I test my robots.txt file?

Google Search Console includes a robots.txt report showing the file Google last fetched and any parsing errors it found. It is worth checking after every change, particularly on a large site, since a single misplaced character can block far more than you intended. Also load the file in a browser to confirm it returns correctly at the root URL.

Can robots.txt actually stop a crawler from accessing my site?

No. robots.txt is a request, not a security control, and it relies entirely on the crawler choosing to comply. Legitimate search engines and major AI operators honour it. Malicious scrapers ignore it completely. Use this Robots.txt Generator to manage well-behaved crawlers, and use server-level authentication, IP blocking, or firewall rules for anything that genuinely needs protecting.

Comments

Login to leave a comment

No comments yet. Be the first to comment!