robots.txt Templates: Copy-Paste Examples for Common Policies

Start with a copy-ready robots.txt example that matches the result you need, then merge it with the live file instead of replacing existing rules blindly. Use the specialized templates for AI crawlers, WordPress, Shopify, and business sites, and test the published result before relying on it.

Copy-paste starter robots.txt templates

If you need a robots.txt template quickly, start with the smallest policy that matches the result you actually want. These examples are intentionally short so you can see what each line changes before you merge it into the file your site already serves.

Allow normal crawling and declare the sitemap

This is a simple public-site starting point when you do not need crawler-specific restrictions:

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

Replace example.com with the canonical host. If the live file already contains platform rules, path restrictions, or additional sitemap declarations, preserve the rules you still need instead of replacing the whole file.

Keep ordinary crawling open and block selected training or dataset crawlers

This example keeps the wildcard group open while adding separate full-site blocks for three documented crawler names commonly associated with model training or dataset collection:

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

This does not mean that every AI-related product is blocked. Search crawlers, user-requested fetchers, provider-specific product controls, renamed agents, and clients that ignore robots.txt require separate decisions. Review the current provider documentation and use the narrower templates below when your policy needs more precision.

Choose a template by the result you need

A robots.txt template is useful when your goal is already clear: keep ordinary search available, restrict a documented training crawler, block a provider's dedicated agents, or adapt a platform-managed file. Start with the narrowest template that produces the result you actually want. A longer crawler list is not automatically safer.

Your goalBest starting templateReview before publishing
Keep ordinary and AI-search discovery available while restricting selected training or dataset crawlers Allow Search, Block AI Training Confirm each crawler's current purpose and preserve any path restrictions already present in the live file.
Block OpenAI's training-oriented crawler without blocking ChatGPT search Block GPTBot Do not add OAI-SearchBot unless you also intend to reduce ChatGPT search discovery.
Publish a broader block for OpenAI's documented crawler names Block OpenAI Crawlers The broader policy can affect training, search visibility, and user-requested retrieval differently.
Control Anthropic's documented crawler names Block Claude Crawlers Decide separately for ClaudeBot, Claude-SearchBot, and Claude-User instead of treating them as one purpose.
Opt out of Perplexity's automatic search crawling Block Perplexity Crawlers Blocking PerplexityBot can reduce discovery in Perplexity search, and user-triggered access may require enforceable server controls.
Restrict the uses controlled by Google-Extended while keeping Google Search available Block Google-Extended Keep Googlebot separate. Google-Extended is not a replacement for a Googlebot rule.
Use a broad starter list for dedicated AI-related agents Block All AI Crawlers No fixed list covers every current or future client. Review the visibility consequences of every included token.
Edit a WordPress-managed robots.txt policy WordPress robots.txt Template Identify whether WordPress, an SEO plugin, a physical file, or another layer generates the public response.
Edit Shopify's generated robots.txt output Shopify robots.txt Template Extend the platform output through the supported theme mechanism instead of replacing Shopify's defaults with a generic static file.
Start with a balanced policy for a public business website Small Business robots.txt Template Replace the example sitemap URL and remove every crawler group that does not match your actual policy.

Use a template for a known outcome and the Generator for a custom policy

Choose a template when one existing policy closely matches your goal and you are comfortable merging it into the file your site already serves. Use the robots.txt Generator when you need to combine several crawler decisions, add host-specific sitemap information, define blocked paths, or review a policy assembled from multiple choices.

A template and the Generator both produce a starting policy. Neither publishes to your hosting account or replaces the need to inspect the complete live file.

Build a custom robots.txt policy Check a live robots.txt file

Open the current live file before copying anything

Visit the exact host's public robots.txt URL first, such as https://example.com/robots.txt. Save the current text and determine what generates it. A CMS, ecommerce platform, SEO plugin, application route, CDN, or hosting layer may already control the response.

Do not replace the existing file blindly. It may contain platform rules, path restrictions, comments, crawler-specific groups, and one or more Sitemap: declarations that the chosen template does not include. The safest change is usually to merge only the groups required by the new policy.

  • WordPress: confirm whether the public file is virtual, physical, filtered by a plugin, or served by the web server.
  • Shopify: preserve the platform-generated output and use the supported robots.txt.liquid mechanism when customization is genuinely needed.
  • Custom applications: check whether the route is generated dynamically and whether deployment or cache layers can overwrite a manual file.

Keep crawler purposes separate

One provider can publish different names for model-development crawling, search discovery, user-requested retrieval, or product-specific content-use controls. A provider name alone is therefore not a precise policy.

Before choosing a template, write down the outcome for each relevant category:

  • Ordinary search: should Googlebot, Bingbot, Applebot, and other search crawlers remain able to fetch public pages?
  • AI search discovery: do you want dedicated AI-search crawlers to discover and cite public content?
  • Model training or product use: which documented training crawlers or product-control tokens do you intend to restrict?
  • User-triggered retrieval: should an assistant be able to retrieve a public page after a person requests it?
  • Dataset and SEO crawling: do Common Crawl, Ahrefs, Semrush, or other third-party crawlers fit your policy?

Use separate User-agent groups when the answers differ. Do not convert a narrow policy into User-agent: * unless blocking all compliant crawlers is intentional.

Check how new groups interact with existing path rules

A crawler-specific group does not automatically inherit restrictions from User-agent: *. Adding an exact group that contains only Allow: / can therefore open paths that were blocked only in the wildcard group.

User-agent: *
Disallow: /account/
Disallow: /internal-search/

User-agent: ExampleSearchBot
Allow: /

In this example, the specific group may be selected for ExampleSearchBot, while the wildcard restrictions are not merged into it. If that crawler must still avoid the two paths, repeat the applicable restrictions in its specific group and test the complete result.

This is why the narrowest useful template is usually safer than a file filled with explicit allow-all groups.

Move from a template to a verified live policy

  1. Choose by outcome. Select the smallest template that matches the crawler purpose and visibility trade-off you intend.
  2. Save the current live file. Keep a copy before editing so the platform rules and sitemap declarations can be restored.
  3. Confirm every crawler name. Check the provider's current documentation before relying on an important block or allow decision.
  4. Merge instead of replace. Add the required groups to the active source and preserve unrelated rules.
  5. Review the complete policy. Look for duplicate groups, contradictory paths, exact groups that bypass wildcard restrictions, and an incorrect sitemap host.
  6. Publish at the correct root. The policy must be served as /robots.txt for the exact scheme, host, and port it is intended to govern.
  7. Verify the live response. Open the URL directly and confirm that the intended plain text is returned with a usable HTTP response.
  8. Test crawler and path combinations. Use the Checker for the exact public and restricted URLs that matter.

Test more than the homepage

A homepage test cannot prove that the rest of the policy is correct. After publishing, test at least:

  • the homepage with every crawler you deliberately blocked or allowed;
  • a public article, product, or documentation URL;
  • account, administration, internal-search, staging, and other restricted paths;
  • a neighboring path that should produce the opposite result;
  • ordinary search crawlers when search visibility must remain available;
  • the canonical host and any separately served subdomain that has its own policy.

Inspect the selected group and winning rule, not only the final Allowed or Blocked label. Then review server logs separately when you need evidence of actual crawler requests.

Understand the limits of every robots.txt template

A template communicates crawling instructions to clients that choose to follow the protocol. It cannot authenticate a crawler, stop a spoofed user-agent, secure private content, delete material already collected elsewhere, or guarantee inclusion in search or AI answers.

Robots.txt also manages crawling rather than guaranteed removal from an index. Protect private, paid, personal, or administrative resources with authentication, authorization, application permissions, and server-side controls. Use indexing controls when the goal is to keep a page out of search results.

No template can remain complete forever. Provider names, product roles, platform behavior, and your own publishing goals can change. Review the live policy after major platform updates, domain migrations, new subdomains, crawler documentation changes, and unexpected traffic.

Need a policy that does not match one template?

Use the Generator to build crawler-specific groups and path rules, merge the result with the existing file, and then verify the published robots.txt policy. The service workflow is designed for cases where a copied example is not specific enough for the site you actually operate.

Protocol references

For the protocol's group and path-matching rules, review RFC 9309. For Google-specific crawling and indexing limitations, review Google Search Central's robots.txt introduction.

Browse this section

Website allowing search and AI discovery routes while blocking a separate model-training collection route

Allow Search, Block AI Training robots.txt Template

Use separate user-agent groups: block documented training or dataset agents such as GPTBot and ClaudeBot, while allowing ordinary search and dedicated AI-search crawlers.

Website blocking several dedicated AI access routes while leaving a separate ordinary search route open

Block All AI Crawlers robots.txt Template

Use explicit groups for known AI-related tokens rather than User-agent: *. This broad template blocks documented training, AI-search, dataset, and user-request agents while leaving ordinary search open.

Three separate Claude crawler routes blocked by independent robots.txt rules while regular search remains open

Block Claude Crawlers robots.txt Template

To block Anthropic’s documented Claude agents, publish separate Disallow groups for ClaudeBot, Claude-SearchBot, and Claude-User. Blocking all three also removes training, Claude search discovery, and user-directed retrieval, so use only the groups that match your policy.

Google Search route remaining open while a separate Google-Extended AI use route is blocked

Block Google-Extended robots.txt Template

Add a Google-Extended Disallow group to restrict eligible content from Gemini model training and grounding uses. Google-Extended is a control token rather than a separate HTTP crawler, and Google states that blocking it does not affect inclusion or ranking in Google Search.

Training crawler route blocked at a website while a separate AI search discovery route remains open

Block GPTBot: Minimal robots.txt Template

Use this template when your specific goal is to disallow GPTBot sitewide. It targets OpenAI’s training crawler only; it does not automatically block OAI-SearchBot, which controls ChatGPT Search crawling.

Automated Perplexity crawler stopped by robots.txt while a user-triggered request reaches separate server access controls

Block Perplexity Crawlers robots.txt Template

Use a Disallow group for PerplexityBot to opt out of Perplexity’s automated search indexing. You may also publish a Perplexity-User rule, but Perplexity states that this user-triggered fetcher generally ignores robots.txt, so enforce a real block at the server or application layer.

Website blocking separate OpenAI training, search, and user-request access routes at one policy boundary

OpenAI robots.txt Controls: Training vs ChatGPT Search

OpenAI exposes separate robots.txt controls for GPTBot and OAI-SearchBot. Use them independently: GPTBot controls training-related crawling, while OAI-SearchBot controls automatic crawling for ChatGPT Search visibility.

Shopify storefront preserving default robots rules while adding targeted AI crawler blocks

Shopify robots.txt.liquid for AI Crawlers: Safe Pattern

Shopify recommends preserving its default robots behavior and customizing through robots.txt.liquid. Add AI crawler rules to the generated file instead of replacing the entire Shopify robots.txt with a generic plain-text template.

Small business website keeping search discovery open while selected AI training crawlers are blocked

Small Business robots.txt: Balanced AI Crawler Template

For most small business sites, the safest starting point is to keep public service pages crawlable, publish the sitemap, and make narrow crawler-specific choices instead of blocking broad groups of search and AI agents.

WordPress site generating one managed robots.txt response with AI crawler rules, admin exception, and sitemap

WordPress robots.txt for AI Crawlers: Safe Template

WordPress can generate robots.txt dynamically, and plugins or server files can also control the response. Add AI crawler groups to the active robots.txt output rather than blindly replacing the whole file.

FAQ

Can I copy and paste a robots.txt template exactly as shown?

Use a template as a starting point, not as a blind replacement. Change the example sitemap host, preserve existing platform and path rules that still matter, and test the live file after publishing.

Which robots.txt template should I choose?

Choose the narrowest template that matches the outcome you can state clearly. For example, use the GPTBot template when only OpenAI training crawling is the concern, and use the allow-search/block-training template when search discovery should remain available while selected training controls are restricted.

Is there one universal robots.txt template for every website?

No. Existing platform rules, crawler goals, public and private paths, subdomains, sitemaps, and search-visibility requirements differ. Treat each template as a reviewed starting point rather than a universal replacement file.

Should I replace my entire robots.txt file with a template?

Usually not. Save the current live file and merge only the required groups while preserving platform rules, path restrictions, comments, and sitemap declarations that still serve a purpose.

Can a template block every AI crawler?

No fixed list can cover every current, future, renamed, spoofed, or non-compliant client. A broad template can address documented tokens, but enforceable access restrictions require server-side controls.

Can I block AI training while keeping Google Search and AI search available?

Often yes, when providers publish separate controls for those purposes. Use crawler-specific groups, keep ordinary search crawlers unblocked, and test exact groups carefully because they do not automatically inherit wildcard path restrictions.

Do WordPress and Shopify use a normal physical robots.txt file?

Not necessarily. WordPress can generate a virtual response and plugins or the server may alter it. Shopify generates its own output and supports customization through robots.txt.liquid. Always inspect the public response and use the platform's active mechanism.

How do I verify a robots.txt template after publishing?

Open the live root-level robots.txt URL, confirm the response and text, then test the exact crawler against public and restricted paths in the Checker. Inspect the matched group and winning rule rather than relying on one homepage result.

Can a robots.txt template protect private or paid content?

No. Robots.txt is public and voluntary. Protect private, paid, personal, account, and administration content with authentication, authorization, application permissions, and server-side access controls.