Robots.txt Generator
Search engines and automated web crawlers read your robots.txt file before indexing a single page. A single misplaced slash or conflicting rule can quietly deindex your entire website or leave private administrative directories open to public search results. This free Robots.txt Generator creates 100% RFC 9309 compliant directives tailored to your platform—including WordPress, Shopify, Next.js, and custom architectures. Block unwanted AI training bots (such as GPTBot, ClaudeBot, and CCBot), safeguard your crawl budget, link your XML sitemap, and test any URL path in real time before publishing to production.
Free tool · nothing is uploaded
Robots.txt Generator & Validator
Generate, customize, and audit RFC 9309 compliant crawl directives in real time. Guard against accidental deindexing, block AI training scrapers, and test URL access before deploying to production.
- RFC 9309 Compliant
- AI Bot Guard (GPTBot & Claude)
- Syntax & Health Audit
- Real-Time Path Simulator
1Directives & Crawler Policies
Directs Googlebot and search crawlers to your complete index of canonical URLs.
Baseline directive for User-agent: *.
Blocks GPTBot, ClaudeBot, CCBot, Google-Extended.
Limits crawling frequency per request on engines supporting crawl-delay.
2Excluded & Allowed Path Rules
Paths to block from indexing. Leading slashes / are enforced automatically per RFC 9309.
Explicit allows override disallows when the allow path length is equal to or longer than the disallow match.
3Real-Time Path Simulator
Test whether Googlebot or search crawlers are allowed to access specific URL paths under your current rules.
Robots.txt Safety & Health Score
All crawl directives adhere to RFC 9309 standards with zero nuclear deindexing risks.
Generated Directives
robots.txt
What is a robots.txt file and how does search indexing work?
A robots.txt file is a plain-text configuration file placed in the top-level root directory of a web server (accessible at https://yourdomain.com/robots.txt). Its purpose is to communicate crawling instructions to automated web spiders, search engine user-agents, and automated scrapers. Known formally as the Robots Exclusion Protocol (REP), this file tells compliant search engine bots which URL paths they are allowed or forbidden to request and crawl.
When Googlebot, Bingbot, or an AI scraper discovers a website, requesting /robots.txt is virtually always their initial action before requesting HTML documents, stylesheets, or scripts. If the file exists and returns an HTTP 200 OK status code, the crawler parses its directives line-by-line according to RFC 9309 rules. If the file returns an HTTP 404 Not Found, crawlers assume that no exclusion rules apply and proceed to crawl all discoverable public links on your domain.
It is vital to understand the difference between crawling and indexing. A robots.txt file governs crawling access—it prevents search engines from fetching the contents of a page. However, if an excluded page receives high-authority external backlinks, Google can still index the URL and display it in SERPs without snippet text, stating that "A description for this result is not available because of this site's robots.txt". To completely guarantee that a page does not appear in search results, webmasters must allow search engines to crawl the page and include a <meta name="robots" content="noindex"> tag in the HTML head or an X-Robots-Tag: noindex HTTP response header.
The RFC 9309 standard: How search engines parse crawl directives
For decades, the Robots Exclusion Protocol was an informal standard established by Martijn Koster in 1994. Because different search engines implemented custom extensions and matching interpretations, crawlers often behaved unpredictably. In September 2022, the Internet Engineering Task Force (IETF) published RFC 9309, formalizing the Robots Exclusion Protocol as an official Internet standard adopted across Google, Microsoft Bing, Yandex, and major crawler ecosystems.
RFC 9309 establishes clear, deterministic syntax and precedence rules that every developer and SEO professional should know:
- Longest match precedence: When multiple
AllowandDisallowdirectives match a given URL, the directive with the longest character pattern takes precedence. For example, if a file containsDisallow: /wp-admin/(10 characters) andAllow: /wp-admin/admin-ajax.php(25 characters), a request for/wp-admin/admin-ajax.phpwill match both rules, but the 25-characterAllowdirective wins. Crawlers are therefore permitted to fetch that endpoint. - Tie-breaker rule: If an
Allowand aDisallowrule match the exact same pattern length for a given path, RFC 9309 dictates that the Allow directive wins. - Leading slashes are mandatory: Every path argument for
AlloworDisallowmust begin with a forward slash/(or a wildcard*). Directives written without a leading slash (e.g.,Disallow: admin) are invalid and can lead to unexpected crawler behavior. - Wildcard and end-of-path anchors: The asterisk
*matches zero or more occurrences of any valid URL character. The dollar sign$at the very end of a path pattern designates the end of the URL. For example,Disallow: /*.pdf$excludes any URL ending precisely in.pdf, while still allowing a URL such as/download.pdf?ref=homepage. - File size limit: RFC 9309 establishes that crawlers are required to parse at least 500 kibibytes (512,000 bytes) of a
robots.txtfile. Any directives placed beyond the 500 KB limit may be truncated and ignored by search engines. Clean, concise files generated by this tool remain well under 2 KB, preventing truncation risks entirely.
Why you must control AI scrapers and LLM training crawlers in 2026
The explosive rise of large language models (LLMs) and generative search has fundamentally transformed crawler traffic. Webmasters today face two distinct categories of crawlers:
- Traditional search engine crawlers: Googlebot, Bingbot, Baiduspider, and Applebot index web content to send organic referral traffic back to publishers via clickable search links.
- Autonomous AI training bots and web extractors: GPTBot (OpenAI), ClaudeBot and anthropic-ai (Anthropic), CCBot (Common Crawl), Google-Extended (Google Gemini training), Bytespider (ByteDance), and PerplexityBot. These bots harvest massive volumes of original text, documentation, research, and proprietary copy to train commercial foundation models, often without providing referral traffic back to the source.
Fortunately, OpenAI, Anthropic, Google, and other major AI labs officially honor RFC 9309 directives declared for their specific user-agents. By adding targeted User-agent blocks with Disallow: /, you can instruct commercial model trainers to bypass your site while preserving standard search visibility on Google and Bing.
For example, Google explicitly maintains a separation between Googlebot (which crawls pages for Google Search indexing) and Google-Extended (which gathers data for Gemini and Vertex AI training). Disallowing Google-Extended protects your intellectual property from training sets without inflicting any penalty on your Google Search rankings.
Common robots.txt mistakes that destroy SEO rankings
Because search engines treat robots.txt as an authoritative gatekeeper, small typographical errors can have catastrophic consequences for website traffic. Over the past decade of auditing client sites, these are the five most damaging mistakes encountered:
- The nuclear staging deindex (
Disallow: /): When developers clone production databases to staging servers, they routinely addUser-agent: *followed byDisallow: /to keep pre-release builds out of search results. When the site launches, teams frequently push the stagingrobots.txtfile straight to production. Within days, Google drops organic rankings across the entire domain. Always audit your robots.txt immediately following any major site migration. - Blocking CSS and JavaScript rendering assets: Historically, webmasters blocked folders like
/wp-content/,/assets/, or/js/to conserve server resources. Today, Googlebot operates as a headless Chrome browser that must render HTML, CSS, fonts, and JavaScript to calculate page layouts, mobile responsiveness, and Core Web Vitals. Blocking layout stylesheets or scripts causes Googlebot to render a broken page, resulting in mobile usability penalties and indexing demotions. - The WordPress
admin-ajax.phpblunder: WordPress administrators frequently addDisallow: /wp-admin/. However, modern themes and plugins rely on/wp-admin/admin-ajax.phpto render front-end pagination, reviews, interactive calculators, and eCommerce filters. If you disallow/wp-admin/without adding an explicitAllow: /wp-admin/admin-ajax.phpexception, Googlebot cannot render dynamic content correctly. - Using deprecated
Noindexdirectives: In September 2019, Google officially terminated support for unofficialNoindex:directives inrobots.txt. Search engines now treatNoindex: /pageas an invalid rule or plain Disallow. If you wish to deindex a page, do not placenoindexin robots.txt; use an in-page<meta name="robots" content="noindex">tag instead. - Missing XML Sitemap directive: While search engines can discover sitemaps via Google Search Console, placing
Sitemap: https://yourdomain.com/sitemap.xmlat the bottom of your robots.txt file is universally supported by Google, Bing, Yahoo, Yandex, and Baidu. It ensures immediate discovery by secondary engines where you might not have manual webmaster accounts configured.
CMS comparison: WordPress, Shopify, Next.js, and static architectures
Different content management systems and application frameworks have distinct directory structures and internal routing conventions. The table below details recommended robots.txt crawl configurations for popular web platforms:
| Platform | Key Excluded Directories | Required Allow Exceptions | Recommended AI Policy |
|---|---|---|---|
| WordPress & WooCommerce | /wp-admin/, /wp-includes/, /*?s=, /cart/, /checkout/, /my-account/ |
Allow: /wp-admin/admin-ajax.php, Allow: /wp-includes/js/ |
Block AI training scrapers (GPTBot, ClaudeBot, CCBot) |
| Shopify & Headless Commerce | /admin, /cart, /orders, /checkout, /*?*sort_by=*, /*?*filter* |
Shopify manages core rules automatically; customize via robots.txt.liquid |
Block AI scrapers to prevent catalog scraping |
| Next.js / Nuxt / Modern SaaS | /api/, /app/, /dashboard/, /settings/, /auth/, /internal/ |
Allow: /api/public/ (if exposing public REST/JSON data) |
Block AI training scrapers; keep public marketing pages open |
| Static Sites & Blogs | /private/, /tmp/, /drafts/, /*.pdf$ |
Allow: / |
Block AI model scrapers unless open distribution is desired |
| Staging Environments | Disallow: / (Block entire domain) |
None (Combine with HTTP Basic Authentication) | Disallow all user-agents unconditionally |
Step-by-step: How to deploy and verify your robots.txt file
Once you have configured and validated your directives using the tool above, follow this deployment checklist to push your file live safely:
- Save and name the file: The file must be named strictly in lowercase as
robots.txt. File extensions like.TXTor names likerobot.txtwill be ignored by search engines. - Upload to the server root: Upload the file to your web server's primary document root folder (e.g.,
public_html/,www/, or your framework'spublic/directory). It must resolve directly athttps://yourdomain.com/robots.txt. Placing it in a subfolder such ashttps://yourdomain.com/assets/robots.txthas zero effect on root crawling. - Verify HTTP response headers: Open your browser's Developer Tools network tab and request
https://yourdomain.com/robots.txt. Verify that the server returns an HTTP200 OKstatus code and aContent-Type: text/plainheader. Ensure that your CDN or caching layer does not redirect or inject HTML wrapper elements. - Test in Google Search Console: Open Google Search Console, navigate to the Settings > Robots.txt report, and confirm that Googlebot has fetched your latest version without fetch errors. Use the URL Inspection Tool to verify that live URLs on your site are properly crawlable.
Honest limitations of robots.txt: What it can and cannot do
While a robots.txt file is an indispensable SEO tool, webmasters frequently misunderstand its security and indexing boundaries. Keep these three critical limitations in mind:
- It does not guarantee deindexation: If other websites link to your disallowed URL with descriptive anchor text, search engines may still index the URL based on external signals alone. To ensure a page is permanently omitted from search indexes, keep it crawlable and apply a
noindexmeta tag, or protect the directory with server-level authentication. - It provides zero data security: A
robots.txtfile is completely public. Anyone can visit/robots.txtand view every private directory or secret admin endpoint you have listed. Never use robots.txt to hide sensitive user records, financial databases, or unreleased product files. Protect sensitive routes with OAuth, password gates, or IP firewalls. - Malicious scrapers and rogue bots ignore it: Reputable search engines (Google, Bing, Yahoo) and major AI labs honor RFC 9309 voluntarily. Malicious bots, email harvest scrapers, vulnerability scanners, and content scrapers completely ignore robots.txt directives. Web application firewalls (WAF) such as Cloudflare or AWS WAF are required to block malicious traffic at the network edge.
Frequently asked questions (FAQs)
Where must the robots.txt file be located on my website?
The file must reside in the highest-level root directory of your domain. For instance, if your site is https://example.com, your file must resolve directly at https://example.com/robots.txt. A file located in a subdirectory (such as https://example.com/blog/robots.txt) cannot govern crawling rules for the rest of the site and will be ignored by search engine crawlers.
Do I need a robots.txt file if I want search engines to crawl everything?
While search engines will crawl a site that lacks a robots.txt file by default, having one is considered an industry best practice. It provides an authoritative location to declare your XML sitemap URL, lets you block unneeded administrative endpoints to preserve server resources, and enables you to prevent unauthorized AI model training scrapers from vacuuming your original content.
Does Googlebot support the Crawl-delay directive?
No. Googlebot explicitly ignores the Crawl-delay directive in robots.txt. Google automatically calculates crawl velocity based on your server's responsiveness and crawl budget. However, Microsoft Bing and Yandex both honor Crawl-delay (measured in seconds). If your server experiences performance bottlenecks during high-traffic crawl windows, specifying a delay can help manage non-Google crawl frequency.
What is the difference between Disallow: and Disallow: / ?
A directive written as Disallow: (with an empty path) tells crawlers that nothing is disallowed—in other words, the crawler is permitted to access every path on the site. Conversely, Disallow: / (with a forward slash) instructs crawlers to block the root directory and everything beneath it, effectively deindexing your entire website. Mixing up these two directives is one of the most common causes of accidental organic traffic loss.
Can I block generative AI bots without hurting my SEO rankings on Google?
Yes. Companies like OpenAI and Google provide distinct user-agents for model training versus web search. By disallowing GPTBot, CCBot, ClaudeBot, and Google-Extended, you block commercial AI scraping for training datasets while allowing Googlebot and Bingbot to crawl, index, and rank your content in standard organic search results.
How does robots.txt handle uppercase and lowercase letters in URL paths?
Per RFC 9309, path directives in robots.txt are strictly case-sensitive. A directive specifying Disallow: /admin/ will only match URLs starting with /admin/ and will not match /Admin/ or /ADMIN/. Ensure that your directive paths match the exact letter casing used in your canonical URL structure.
How long does it take for Google to detect changes to my robots.txt file?
Google typically caches robots.txt files for up to 24 hours. If you make urgent updates (such as removing an accidental Disallow: / directive), you can expedite the refresh by submitting your updated file inside the Google Search Console Robots.txt Tester, which prompts Googlebot to refetch the file within minutes.
Related tools and internal resources
Optimize your complete technical SEO architecture with our suite of free browser-based tools: audit on-page metadata with our Meta Title & Description Generator, preview search snippets with the SERP Snippet Preview tool, run a full page analysis with the On-Page SEO Auditor, structure your site architecture with the Internal Link Planner, build rich snippets with the Schema Markup Generator, and accelerate search growth through our comprehensive SaaS SEO and Organic Promotion Services.
