robots.txt Generator
Developer ToolsGenerate a valid robots.txt file for your website. Control crawler access per user-agent, set allow and disallow paths, and add your sitemap URL — free.
What is a robots.txt?
Every website has the option to place a robots.txt file at its root — at the path /robots.txt — to communicate crawling preferences to search engine bots and other automated agents. The Robots Exclusion Protocol, which governs this file, is an informal but widely respected standard followed by Googlebot, Bingbot, DuckDuckBot, GPTBot, and dozens of other compliant crawlers.
A robots.txt Generator creates this file for you from a form interface, eliminating the need to hand-write the directives and check them for syntax errors. The file format is simple but unforgiving: a single misplaced space or an incorrect path prefix can accidentally block your entire website from Google — a mistake that can take weeks to reverse once search engines process the change.
The file consists of one or more rule blocks. Each block opens with a User-agent: line identifying the targeted crawler, followed by Allow: or Disallow: directives for individual paths or directories. An optional Crawl-delay: directive controls how fast a crawler may request pages. A Sitemap: directive at the end points crawlers to your XML sitemap.
Understanding what robots.txt does and does not do is critical: it controls whether a crawler visits a URL, but it does not control whether that URL appears in search results. A page can be indexed by Google without ever being crawled, if enough other sites link to it. For true de-indexing you need a noindex meta tag on the page itself.
Common legitimate uses for robots.txt include:
- Blocking crawlers from
/admin/,/checkout/, or other non-public paths that waste crawl budget - Preventing duplicate content from being crawled (e.g. filtered search result URLs like
/products?sort=price) - Blocking AI training crawlers (GPTBot, Google-Extended) from proprietary content
- Pointing all crawlers to your sitemap via the
Sitemap:directive
Pair this tool with Sitemap.xml Generator to complete the two foundational technical SEO files every website needs, and use UTM Link Generator to make sure traffic that does reach your site is properly attributed in your analytics platform.
How to use this robots.txt calculator
- Select the User Agent from the dropdown — choose All bots (*) for a global crawl rule, or select a specific crawler (Googlebot, Bingbot, GPTBot) to target just that bot.
- If you selected Custom, type the exact crawler name in the Custom User Agent Name field — use the crawler's official name as documented by its operator.
- Enter paths in the Allow Paths text area that should remain accessible even if a broader Disallow rule would otherwise block them — one path per line, starting with
/. - Enter paths in the Disallow Paths text area that crawlers should skip — use full directory paths ending with
/for directories, or exact file paths for individual files. - Optionally enter a number in Crawl Delay if you want to slow down non-Googlebot crawlers — note that Googlebot ignores this setting.
- Enter your sitemap URL in Sitemap URL — this should be the absolute URL to your
sitemap.xmlfile (e.g.https://example.com/sitemap.xml). - Copy the generated robots.txt Content from the output box and upload it as a file named
robots.txtto the root directory of your web server (the same directory that contains your homepage'sindex.html).
Formula & Methodology
The robots.txt file follows the Robots Exclusion Protocol. The generator assembles directives in this order:User-agent: [agent] Allow: [path] ← zero or more, before Disallow rules Disallow: [path] ← zero or more Crawl-delay: [n] ← optional ← blank line between blocks Sitemap: [url] ← outside any user-agent block, at end of filePath matching rules: -Disallow: /admin/— blocks the/admin/directory and everything under it -Disallow: /admin— blocks any URL starting with/admin(including/admin-panel/) -Disallow: /*.pdf$— blocks all PDF files (supported by Google, not all crawlers) -Allow: /with no Disallow — permits all paths (equivalent to no robots.txt for that agent) -Disallow: /— blocks all paths for the specified agent Example output for a typical site:User-agent: * Allow: / Disallow: /admin/ Disallow: /checkout/ Disallow: /account/ Crawl-delay: 1 Sitemap: https://example.com/sitemap.xmlThis allows all bots to crawl everything except the three protected directories, asks non-Google crawlers to wait one second between requests, and points every crawler to the sitemap.
Frequently Asked Questions