Skip to content
SentrueTools
Tools

Robots.txt Generator

liveFree

Generate and test robots.txt rules, including presets for blocking AI crawlers.

How to use Robots.txt Generator

What robots.txt does (and does not do)

robots.txt is a plain text file at the root of your site, such as https://example.com/robots.txt, that tells crawlers which paths they may request. It was standardized in 2022 as RFC 9309, the Robots Exclusion Protocol, and every major search engine follows it.

It controls crawling, not indexing. A page blocked in robots.txt can still appear in search results, without a description, if other sites link to it, because Google can see that the URL exists but is not allowed to read it. To keep a page out of search results, let it be crawled and add a noindex robots meta tag or X-Robots-Tag header, or protect it with a password. robots.txt is also not a security measure: anyone can read it, and badly behaved bots ignore it.

What it is good at is steering crawlers away from URLs that waste their time: admin areas, internal search results, endless filter combinations, cart and checkout pages, and API endpoints.

How to use the generator

  1. Start from a preset that matches your platform, or from the default “allow everything” file.
  2. Edit the groups. Each group names one or more user agents and lists Allow and Disallow rules for them.
  3. Add your sitemap URLs so crawlers can find every page you want indexed.
  4. Test URLs in the tester with different crawlers until the results match what you expect.
  5. Check the problems panel, then download the file and upload it to the root of your domain. A robots.txt in a subfolder is ignored.

To start from your current file instead, enter your domain under Fetch a live robots.txt. The live file replaces the groups in the editor, and Undo brings your previous ones back. Your work is saved in this browser between visits.

How robots.txt files are structured

User-agent: GPTBot
User-agent: CCBot
Disallow: /

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://example.com/sitemap.xml
  • A group starts with one or more User-agent lines followed by rules. Consecutive user-agent lines share the same rules.
  • Disallow blocks every URL whose path starts with the value. Allow makes an exception. An empty Disallow: blocks nothing.
  • Sitemap lines apply to the whole file, not to one group, and must be full URLs.
  • Paths are case-sensitive and start with /. They include the query string, so /search?q= matches /search?q=shoes.

A detail that catches many hand-written files: a blank line does not end a group. A User-agent line with no rules under it joins the next group’s user agents and silently inherits its rules. The generator always writes at least one rule per group (an empty Disallow: when you add none) so this cannot happen.

Wildcards and matching rules

Two characters are special in paths:

  • * matches any sequence of characters, including none. /*.pdf matches every PDF, and /collections/*sort_by* matches any collection URL with a sort_by parameter.
  • $ at the end of a path anchors it to the end of the URL. /*.php$ matches /index.php but not /index.php?page=2.

When several rules match a URL, the most specific one wins, which means the one with the longest path. If an Allow rule and a Disallow rule are equally long, Allow wins. Order in the file does not matter. For example:

Rules URL Result
Allow: /p and Disallow: / /page Allowed: /p is longer than /
Allow: /folder and Disallow: /folder /folder/a Allowed: equal length, Allow wins
Allow: /page and Disallow: /*.htm /page.htm Blocked: /*.htm is longer than /page
Allow: /$ and Disallow: / / Allowed: only the homepage

Characters outside plain ASCII are compared in their percent-encoded form, and the generator writes them that way, so /café in the editor becomes /caf%C3%A9 in the file. The file /robots.txt itself can always be fetched.

Which group does a crawler use?

A crawler uses one set of rules: the group whose user agent matches its name, compared without regard to case. If no group names it, it uses the * group. If there is no * group either, it may crawl everything. If the same name appears in several groups, their rules are combined.

Google adds one documented refinement for its own crawlers: a specialized crawler such as Googlebot-Image uses a googlebot group when there is no googlebot-image group. The tester follows the same logic and always tells you which group and which line decided the result.

This means a specific group replaces the * group for that crawler; it does not add to it. If you write User-agent: Googlebot with a single rule, Googlebot ignores everything in the * group, including rules you meant for every crawler. Repeat the shared rules in the specific group.

Presets

  • WordPress blocks /wp-admin/ while allowing /wp-admin/admin-ajax.php, which themes and plugins call from public pages, plus internal search results (/?s= and /search/).
  • Shopify reproduces the core of Shopify’s default rules: admin, cart, checkout, account and order pages, internal search, sorted and filtered collection URLs and theme preview parameters. Shopify generates robots.txt itself from the robots.txt.liquid theme template, so use this preset to understand and test the rules and make changes in that template.
  • Headless / Next.js blocks /api/ routes. It leaves JavaScript and CSS, such as /_next/static/, crawlable: Google renders pages like a browser, and blocking those files can break how it sees your content.
  • Allow everything and Block everything are the two extremes. Use Block everything only on staging sites.

Applying a preset replaces your groups (Undo restores them) but keeps your sitemap lines and the AI crawler block.

Blocking AI crawlers

Block AI crawlers adds one group that disallows the whole site for GPTBot and ChatGPT-User (OpenAI), CCBot (Common Crawl), Google-Extended (Google’s AI training control), ClaudeBot (Anthropic), PerplexityBot, Bytespider (ByteDance) and Applebot-Extended (Apple’s AI training control). Search engine crawlers such as Googlebot and Bingbot are not affected, so your search visibility stays the same. Google-Extended and Applebot-Extended are not separate crawlers: they are tokens that tell Google and Apple whether content they already crawl may be used for AI models.

These companies say their crawlers respect robots.txt, but it is a request, not an enforcement mechanism. New AI crawlers appear regularly, so review the list from time to time.

Crawl-delay and other directives

Crawl-delay asks a crawler to wait between requests. Bing and Yandex use it; Google ignores it and adjusts its crawl rate to how quickly your server responds, so the problems panel warns when you set one. Other non-standard directives found in a fetched file, such as Yandex’s Clean-param, are kept in their group so they are not lost.

Google reads only the first 500 KiB of a robots.txt file and caches it for up to a day, so changes can take a while to apply.

Testing your rules

The tester accepts a path (/private/page?x=1) or a full URL and a crawler name, and shows Allowed or Blocked together with the rule and line that decided it, or the reason no rule applied. Test the URLs that matter most before you publish: your homepage, a typical product or article page, a page you meant to block, and a CSS or JavaScript file your pages need.

Privacy

The generator and tester run in your browser, and your work is saved only in this browser’s storage. When you fetch a live robots.txt, only that one address is sent to our fetch service, which downloads the file and returns it to your browser.

Frequently asked questions

Can robots.txt block AI crawlers?

Well-behaved AI crawlers such as GPTBot, ClaudeBot and Google-Extended respect robots.txt rules for their user agent. The Block AI crawlers preset adds them in one click without affecting search engines.

Does Google respect crawl-delay?

No. Google ignores the crawl-delay directive. Other crawlers may honour it.

Does blocking a page in robots.txt remove it from Google?

No. robots.txt controls crawling, not indexing. To remove a page from results, allow crawling and add a noindex meta tag or X-Robots-Tag header.

Which rule wins when Allow and Disallow both match?

The rule with the longest path wins. If both are the same length, Allow wins. The order of the lines does not matter.

Where does robots.txt have to be?

At the root of the host, such as https://example.com/robots.txt. Each subdomain and protocol needs its own file.

How long does Google take to see changes?

Google usually caches robots.txt for up to 24 hours, so changes can take a day to apply.