robots.txt generatorCreate the right robots.txt file in minutes.

Start with a ready-made template, add your own rules and, if you like, block AI bots. The file builds as you type; we immediately flag rules that close your site to search engines, block CSS and JavaScript files, or are written incorrectly.

Free, no account needed. Your data is processed in your browser and isn't sent to the server.

Rules

Custom rules
* in the User-agent field means all bots. A Block rule is written to the file as Disallow, an Allow rule as Allow. The path is the part after the domain name and starts with /; * means any sequence of characters, and $ means the end of the URL.
AI bots
Sitemap and other settings
Crawl-delay is written to the all-bots group; Bing follows it, Google and Yandex ignore it.

Preparing output…

Step-by-step guide

  1. Choose a template. “Allow everything” writes an empty Disallow: line and blocks nothing. “WordPress” closes the admin area and internal search results (/?s=, /search/) while leaving open the admin-ajax.php file that themes and plugins use on the front end. “E-commerce site” closes the cart, account, checkout and search pages as well as sorting and filter parameters. Changing the template rewrites the rule list from scratch, so pick the template first and add your own rules afterwards.
  2. Add your own rules. Each row has a bot, a rule type and a path. Rows written for the same bot are combined into a single group in the file, and the * group always comes first. If you type a full URL in the path field, the tool strips the domain; if you forget the leading slash, it adds one, and it notes both in the Checks list.
  3. Decide about AI bots. The two options are independent of each other. The training option gathers 14 bots, the answer option 10 bots, each into one group, and writes Disallow: / for it. If you only want to stop training, leave the second box unticked.
  4. Enter the sitemap and Crawl-delay. If you enter the site address, short paths such as /sitemap.xml are completed to a full URL; without a site address, a sitemap line written as a relative path is left out of the output. Crawl-delay is written into the * group and only affects bots that follow this directive.
  5. Read the checks, then download. If the badge above the output says “No issues”, the file is ready to publish. Don't download it before fixing critical and warning lines. The “Download” button saves the file as robots.txt, or as robots.txt.liquid for the Shopify template.

Information notes in the Checks list (what the wildcards mean, “Blocking isn't the same as removing from the index” and so on) don't report errors; they remind you of the side effects of the rules you've chosen. Warnings are for cases where bots might misread a rule or where you might be blocking something you didn't intend to. A critical finding only appears for rules that close the whole site or a search engine.

Common problems and how to fix them

The whole site is closed to search engines

The “Block everything” template is meant for sites that aren't ready to go live and produces a critical finding. The real risk is this file being copied from the staging server to the live site. Protecting the staging environment with a password instead of robots.txt is safer: a password keeps out both bots and curious visitors, and leaves no blocking file that could be carried over to production. In Nginx, basic authentication is turned on like this:

location / {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

In Apache, the same is done with the AuthType Basic, AuthUserFile and Require valid-user lines in the .htaccess file.

CSS and JavaScript folders are blocked

Closing a folder such as /wp-content/, /assets/ or /_next/ also closes the stylesheets and scripts Google needs to render the page; the tool shows this as a warning. The best fix is to delete the rule. If you need to keep the folder closed, remember that Google applies the longest matching rule: a short Allow: /*.css$ line can't beat the longer Disallow: /wp-content/ rule, whereas Allow: /wp-content/*.css and Allow: /wp-content/*.js lines can. Leave out the trailing $ too: WordPress adds a version parameter such as ?ver=6.5 to stylesheet and script URLs, and a rule ending in $ doesn't match them.

Writing a group for one bot made the general rules disappear

Say you added Disallow: /pdf/ for Googlebot only. Googlebot now ignores the cart and search rules in the * group; the tool shows this with the warning “only follows the rules in its own group” and the number of rules that won't apply. There are two fixes: if the rule applies to all bots, write it with *, or add the lines of the * group again under the same bot name. When you add a new row, the tool automatically selects the bot from the previous row, which makes it easy to write several rules for the same bot in a row.

Crawl-delay is too high or invalid

Crawl-delay must be a positive number of seconds; the tool leaves out values that aren't numbers or that exceed 3,600. For values above 10 seconds it also works out how many pages a bot that respects the delay can crawl per day at most: 30 seconds means 2,880 pages a day, so crawling a 10,000-product store from start to finish just once takes more than three days. Unless your server is genuinely struggling, leave the field empty. Google doesn't read this line at all; it adjusts its crawl rate itself based on your server's response time.

Example: robots.txt for a Turkish-language store

magaza-ornek.com is a store that uses only Turkish URLs; its sorting parameter is called siralama and its filter parameter filter. The owner follows these steps:

  1. Selects the “E-commerce site” template. Since the store has no English URLs, removes the /cart, /account, /checkout and /search rows with the delete button next to them.
  2. Changes sort= to siralama= in the two sorting rules.
  3. Ticks the “Block model training bots” box and leaves answer bots open.
  4. Enters https://www.magaza-ornek.com as the site address and /sitemap.xml in the sitemap field.

The first group of the output comes out as shown below. It's followed by a second group that lists the 14 training bots and ends with Disallow: /, and finally by the Sitemap: line completed to a full URL.

User-agent: *
Disallow: /sepet
Disallow: /hesabim
Disallow: /odeme
Disallow: /arama
Disallow: /*?siralama=
Disallow: /*&siralama=
Disallow: /*?filter=
Disallow: /*&filter=

The badge says “No issues”. The Checks list contains only information notes: what the wildcards mean, that 14 training bots are blocked, that blocking isn't removing from the index, that the rules should be matched to the store's URLs, and that the sitemap URL has been completed. The final “Rules are valid” note says the file should be uploaded to https://www.magaza-ornek.com/robots.txt.

Before uploading, watch out for one detail: because paths match as prefixes, the Disallow: /sepet rule also closes a campaign page such as /sepette-indirim. If the store has such a page and its cart URLs all sit under /sepet/, write the rule with a trailing slash. After uploading the file, open the robots.txt tester with the button below the output: /urun/deri-canta?siralama=fiyat should come out Blocked and /urun/deri-canta Crawlable.

Frequently asked questions

What does a robots.txt file do?

robots.txt is a plain-text file in your site's root directory that tells search engine bots which URLs they may crawl. Bots read this file first when they visit a site. The file manages crawling: it protects your server from unnecessary requests and keeps out sections that generate endless URLs, such as cart and filter pages, so that crawl budget goes to important pages. Not having the file at all isn't an error; in that case, the whole site is considered crawlable.

Can I remove a page from Google with robots.txt?

No. A Disallow rule blocks crawling, not indexing: a blocked URL that gets links from other sites can appear in search results without a description. To remove a page from the results, leave it open to crawling and add a noindex meta tag or an X-Robots-Tag header; Google must be able to crawl the page to see the tag.

Should I block AI bots?

There are two kinds of bots. Training bots such as GPTBot, ClaudeBot, Google-Extended and CCBot collect your content to train AI models; blocking them doesn't affect your rankings in Google and Bing. Answer bots such as OAI-SearchBot, PerplexityBot and Claude-SearchBot let ChatGPT, Perplexity and Claude cite your site as a source; if you block them, you won't appear in those answers. Google's AI Overviews run on Googlebot, so they can't be turned off separately with robots.txt.

Where should I upload the file, and how do I test it?

Upload the file as robots.txt to your site's root directory; files in subfolders aren't read, and each subdomain and protocol needs its own file. Google caches the file for up to a day, so changes may not take effect immediately. After publishing, use the robots.txt tester to check which bots a URL is open to, and the AI bot access checker to see whether AI bots can read your site.

Learn more about this topic: robots.txt guide · AI bots guide