Robots.txt Generator

Build a robots.txt file with rules for each crawler and your sitemap.

  • Runs in your browser
  • Free, no sign-up
Start from
Rule groups

    Test a URL

    About the Robots.txt Generator

    The Robots.txt Generator builds the small text file that tells crawlers which parts of your site they may fetch. Start from a preset, edit the rule groups, add your sitemap, and download a ready-to-upload robots.txt. A built-in tester shows whether a given path is allowed or blocked for a given crawler, and which rule decided it.

    The format follows RFC 9309, the Robots Exclusion Protocol standard published in 2022, which Google, Bing and other major search engines follow. Groups start with one or more User-agent lines, then list Disallow and Allow paths, and Sitemap lines can go anywhere in the file.

    Keep in mind what robots.txt is for. It manages crawling, not indexing or security: a blocked page can still appear in results if other sites link to it, and anyone can read the file. Well-behaved crawlers respect it, but nothing forces them to. The tool runs entirely in your browser.

    How to use it

    1. Pick a starting pointAllow everything, Block everything, WordPress or Online shop. Each one fills in the rule groups for you.
    2. Edit the groupsSet the crawlers for each group (* means all), then list the paths to block and the paths to allow, one per line. Add more groups for specific crawlers.
    3. Add your sitemapEnter the full sitemap URL, or several, one per line. Tick the AI crawler option if you want to block those bots.
    4. Test a few pathsType a path such as /cart and a crawler such as Googlebot. The verdict names the rule that matched.
    5. Upload the fileDownload robots.txt and put it at the root of your site, so it opens at https://yoursite.com/robots.txt.

    Key features

    Four presets

    Open site, fully blocked site, WordPress (admin blocked except admin-ajax.php, search pages blocked) and an online shop (cart, checkout, account and sort or filter URLs blocked).

    Any number of groups

    Give Googlebot, Bingbot or any other crawler its own rules, next to the rules for everyone else.

    Standard path matching

    The tester uses the RFC 9309 rules: * matches any characters, $ marks the end of the URL, the longest matching rule wins, and Allow wins a tie.

    AI crawler block

    One switch adds a group for GPTBot, ClaudeBot, anthropic-ai, Google-Extended, Applebot-Extended, CCBot, Bytespider, meta-externalagent, cohere-ai and PerplexityBot.

    Checks while you type

    Warnings for a file that blocks the whole site, for Crawl-delay, for paths that do not start with / and for sitemap URLs that are not full addresses.

    Private by design

    Nothing is uploaded or fetched. The file is built and tested on your device.

    Examples

    The WordPress preset

    User-agent: *
    Disallow: /wp-admin/
    Disallow: /?s=
    Disallow: /search/
    Allow: /wp-admin/admin-ajax.php
    
    Sitemap: https://example.com/sitemap.xml
    PathResult
    /wp-admin/admin-ajax.phpAllowed by "Allow: /wp-admin/admin-ajax.php"
    /wp-admin/options.phpBlocked by "Disallow: /wp-admin/"
    /?s=mugsBlocked by "Disallow: /?s="
    /blog/helloAllowed (no rule matches)

    The admin-ajax.php path is allowed even though it sits inside the blocked folder, because its rule is longer and therefore more specific.

    Prefixes, wildcards and the end of a URL

    Rules match from the start of the path, and they match prefixes. In the Online shop preset:

    PathResult
    /cartBlocked by "Disallow: /cart"
    /cartoonsAlso blocked by "Disallow: /cart"
    /mugs?sort=priceBlocked by "Disallow: /*?sort="
    /mugs?color=blue&sort=priceBlocked by "Disallow: /*&sort="

    That is why the preset blocks both ?sort= and &sort=: the first only matches when sort is the first parameter. To block a single URL and nothing that starts like it, end the rule with $. With Disallow: /*.pdf$, the path /files/menu.pdf is blocked, but /files/menu.pdf?v=2 is not.

    A group for one crawler replaces the * group

    Add a second group for Googlebot with Disallow: /drafts/ next to the shop rules. Now /cart is allowed for Googlebot, because a crawler follows only the group that names it and ignores the * group. Bingbot, which has no group of its own, still follows the * rules. If you give a crawler its own group, copy the general rules into it.

    Tips

    • Keep it short. Block only what crawlers should never fetch, such as carts, internal search results and endless filter combinations.
    • To keep a page out of search results, use a noindex meta tag and let the page be crawled. A robots.txt block hides the tag from search engines.
    • Paths are case-sensitive: Disallow: /Private/ does not block /private/.
    • Each host needs its own file. https://shop.example.com/robots.txt does not apply to https://example.com.
    • After uploading, check the file in Google Search Console's robots.txt report to see the version Google fetched and any parsing problems.

    Common mistakes and limits

    • Blocking CSS and JavaScriptSearch engines render pages much like a browser. If they cannot fetch your styles and scripts, they may misjudge the page, especially on phones.
    • Using robots.txt to hide private pagesThe file is public, so listing secret paths advertises them. Protect private areas with a login, and keep them out of results with noindex.
    • Expecting every bot to obeyrobots.txt is a request, not an access control. Search engines and most AI companies follow it, but some crawlers ignore it.
    • Relying on Crawl-delay for GoogleGoogle ignores Crawl-delay. Bing supports it, and other crawlers vary. Google adjusts its crawl rate to how fast your server responds.
    • Leaving "Disallow: /" from a staging siteA staging file copied to the live site blocks search engines from everything. Check robots.txt after every launch or migration.

    Frequently asked questions

    Where do I put robots.txt?
    In the root of the host, so it loads at https://example.com/robots.txt. Crawlers do not look for it in subfolders.
    What is the difference between Disallow and noindex?
    Disallow stops crawling, so the crawler never reads the page. noindex lets the page be crawled but asks search engines not to show it. For removal from results, noindex is the one that works.
    What do * and $ mean?
    * matches any sequence of characters, so /*?sort= matches any path with ?sort= in it. $ marks the end of the URL, so /*.pdf$ only matches paths that end in .pdf.
    When two rules match, which one wins?
    The most specific one, which means the longest rule. If an Allow and a Disallow rule are equally long, Allow wins. This is how RFC 9309 and Google define it.
    Does blocking AI crawlers affect Google Search?
    No. Google-Extended is a separate token that controls use of your content for Google's Gemini models and does not change how Googlebot crawls or ranks your site. The same goes for Applebot-Extended and Apple search.
    Which AI crawlers does the switch block?
    GPTBot (OpenAI), ClaudeBot and anthropic-ai (Anthropic), Google-Extended, Applebot-Extended, CCBot (Common Crawl), Bytespider (ByteDance), meta-externalagent (Meta), cohere-ai and PerplexityBot. Some are used for model training and some, like PerplexityBot, for AI search answers.
    How big can robots.txt be?
    RFC 9309 asks crawlers to read at least the first 500 KiB, and Google stops there. A normal file is a few hundred bytes.
    How fast do changes take effect?
    Crawlers cache the file, usually for up to a day. Google generally refreshes it within 24 hours.
    Is my file uploaded anywhere?
    No. It is built in your browser. You upload it to your own server yourself.