Search & Research

How Websites Can Control AI Crawlers

Use robots.txt, snippet controls and server rules to manage AI crawlers, and understand what each one can't do.

Key takeaways

  • Robots.txt, standardized in RFC 9309, is a published request that well-behaved crawlers follow, not a lock.
  • AI companies may use separate user agent names for training, search features and user-initiated fetches, so one rule rarely covers all.
  • Blocking a search engine's main crawler removes you from search, which is usually more than you intend.
  • Server rules, rate limits and logins enforce what robots.txt only asks.
  • Crawler names and policies change, so check each operator's documentation and review your logs.

You can ask AI crawlers to stay away with rules in your robots.txt file, limit how search features quote your pages with snippet controls, and enforce restrictions at your server or content delivery network. The first two depend on the crawler's cooperation. The third can actually refuse a request, though it can't catch every disguised visitor.

Before writing any rule, decide what you're trying to prevent. Collecting pages for model training, fetching a page to answer one person's question and indexing for ordinary search are different activities, often run under different names.

Know what kind of visit you're managing

A crawler is a program that fetches pages automatically. Web crawlers explained covers the basics. For AI-related traffic, it helps to separate purposes:

Purpose What happens What blocking costs you
Training collection Pages are gathered to help build models Usually nothing in search traffic
AI search indexing Pages are indexed so answers can cite them You may not appear or be linked
User-initiated fetch A tool opens a page because a person asked That person's assistant can't read it
Classic search crawling Pages are indexed for search results Search visibility
Public web archives Broad crawls shared with many users Removal from that future dataset

Some operators honor robots.txt for user-initiated fetches; others treat those like a person's browser and say rules may not apply. Their documentation should say which.

Writing robots.txt rules

The file lives at the root of each host, for example https://www.example.com/robots.txt. Subdomains need their own. It's made of groups: one or more User-agent lines followed by Allow and Disallow rules.

This example blocks several AI-related agents while leaving everything else open:

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /

User-agent: *
Disallow: /admin/

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

GPTBot (OpenAI), ClaudeBot (Anthropic) and CCBot (Common Crawl) are crawler names their operators have published. Google-Extended and Applebot-Extended are control tokens: they don't correspond to a separate crawler, and they tell Google and Apple how content their crawlers fetch may be used for certain AI purposes. OpenAI and others document additional names for search and user-requested fetches. This list is an illustration and will go out of date.

Three rules of the format trip people up:

  • A crawler follows the group that best matches its name and ignores the * group when a specific one exists. Repeat any general restrictions inside the specific group if you need them.
  • When Allow and Disallow both match, the most specific (longest) path is meant to win.
  • Disallow stops fetching. It doesn't remove already collected copies, and it doesn't guarantee a URL never appears in search.

Test your file with a robots.txt rule matcher before publishing, and see XML sitemaps and robots.txt for the general syntax.

Choosing a control for an automated visitor
Is it a documented crawler that honors robots.txt? YES Add a group for its published name. 1 NO Do you want search listings but shorter excerpts? YES Use snippet controls on those pages. 2 NO Is it ignoring rules or overloading you? YES Rate limit or block at the server or CDN. 3 NO Is the content truly private or paid? YES Require a login. Don't rely on crawler rules. 4 NO Watch and revisit Check logs and operator documentation periodically. Is it a documented crawler that honors robots.txt? 1 IF YES Add a group for its published name. NO Do you want search listings but shorter excerpts? 2 IF YES Use snippet controls on those pages. NO Is it ignoring rules or overloading you? 3 IF YES Rate limit or block at the server or CDN. NO Is the content truly private or paid? 4 IF YES Require a login. Don't rely on crawler rules. NO Watch and revisit Check logs and operator documentation periodically.

Blocking training tokens doesn't necessarily change what appears in a search engine's AI summaries. At Google, those features are part of Search and rely on the ordinary search crawler. Google says the Google-Extended token doesn't affect inclusion in Search. In 2026 Google added a separate Search Console setting that excludes a site from generative AI features in Search, such as AI Overviews and AI Mode, without controlling model training. Check its help pages for availability and current behavior.

To limit how text is shown, engines support page-level directives, such as nosnippet, max-snippet and the data-nosnippet attribute:

<meta name="robots" content="max-snippet:80">
<p data-nosnippet>This paragraph is excluded from excerpts.</p>

The same idea works as an HTTP response header, useful for PDFs and other files:

X-Robots-Tag: nosnippet

These also affect normal search listings, so your results may look thinner. A crawler must be able to fetch the page to see a meta tag or header; if robots.txt blocks it, the directive goes unread. Support varies by engine, and some offer their own settings. Meta tags with names such as noai have been proposed or used by some services, but you shouldn't assume any crawler honors them unless its operator says so.

Standards groups, including within the IETF, have been working on common ways to express preferences about AI use. Check the current status before relying on any new syntax.

Enforcing rules at the server

Robots.txt does nothing to a program that ignores it. Enforcement happens where requests arrive.

  • User agent blocking. Return a 403 status to named agents. Simple, but the name is easy to fake.
  • IP verification. Many operators publish address ranges, or support a reverse DNS check, so you can tell a genuine crawler from an impostor.
  • Rate limiting. Cap requests per client or network and answer excess ones with status 429.
  • Bot management. Content delivery networks and web application firewalls often offer categories for AI crawlers that you can switch on.
  • Authentication. A login or paywall is the dependable barrier for content that mustn't be collected.

A hypothetical nginx rule that refuses two named agents looks like this, placed inside a server block:

if ($http_user_agent ~* "(GPTBot|CCBot)") {
    return 403;
}

Keep robots.txt itself reachable to those agents if you want cooperative ones to read your rules and stop trying. A broad block that answers the file request with an error can be interpreted in ways you didn't intend.

Layers of control, from polite to firm
Robots.txt A public request for crawlers to follow. Page directives Limits on excerpts and indexing, read after fetching. Server and CDN rules Refuse or slow requests by name, address or behavior. Authentication Content is served only to people with access. Terms and agreements Legal or licensing terms, enforced outside the server. Robots.txt A public request for crawlers to follow. Page directives Limits on excerpts and indexing, read after fetching. Server and CDN rules Refuse or slow requests by name, address or behavior. Authentication Content is served only to people with access. Terms and agreements Legal or licensing terms, enforced outside the server.

Verifying that a visitor is who it claims

Because anyone can send any user agent string, a name alone proves nothing. Two checks are common. The first compares the request's IP address with the ranges the operator publishes, often as a downloadable list. Refresh your copy regularly, since ranges change.

The second is a forward-confirmed reverse DNS lookup, which some search operators document. You look up the hostname for the visiting address, confirm it sits under a domain the operator names, then resolve that hostname and confirm it returns the same address. With a documentation address as a placeholder, the commands look like this:

dig -x 192.0.2.10 +short
dig crawler-host.example.com +short

If the first returns a name outside the operator's domain, or the second doesn't return the original address, treat the request as unverified. Some newer proposals have crawlers sign their requests cryptographically; check whether your operator or CDN supports any such method.

A worked policy example

Say you run a hypothetical gardening site with articles, a members-only course and an admin area. You decide that search engines are welcome, you'd like to be cited by AI search tools, you don't want pages collected for training and the course must stay private.

That turns into four actions. Add robots.txt groups that disallow the training agents you've confirmed in their documentation. Leave search-related agents alone. Put the course behind a login, with no public copies of the lessons or their files. Block the admin area with authentication and, if possible, by network address. Finally, write the policy down in a sentence or two, so whoever maintains the site later knows why each line exists and can update it when names change.

Check your logs before and after

Your access logs show who's visiting. Look for user agent strings, request volume, which paths they fetch and whether they request robots.txt. A user agent parser helps you read unfamiliar strings.

After a change, expect some delay, since crawlers cache robots.txt for a while. If a named agent keeps fetching disallowed pages after a few days, verify its address against the operator's published information. It may be someone borrowing the name.

Some automated traffic identifies itself as an ordinary browser. How sites detect automated traffic explains the signals used, and the risk of blocking real people by mistake, including those using assistive technology or privacy tools.

Trade-offs to weigh

Blocking has costs. If AI search tools can't read you, they can't cite you, and a competitor's page may be quoted instead. Allowing everything may mean your work informs answers that send few visitors back, and heavy crawling can raise hosting bills.

There's no universal right setting. A documentation site might welcome assistants because accurate answers reduce support requests. A publisher of original reporting might block training collection while allowing search. A small hobby site might care only about server load. Write down your reasoning so you can revisit it.

Legal questions about collecting and using web content are unsettled in many places and differ by country. A robots.txt rule states your preference; it isn't legal advice or a license. AI crawlers and the fight over web content covers the wider dispute.

A short maintenance checklist

  1. List the purposes you allow and refuse.
  2. Update robots.txt using names from each operator's current documentation.
  3. Add snippet directives only where you accept the effect on listings.
  4. Set rate limits that protect the server without harming visitors.
  5. Put genuinely private material behind authentication.
  6. Review logs and operator pages every few months.

Remember that robots.txt is public. Listing a secret folder there advertises it, so protect sensitive paths with access control instead.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Search & Research →

Latest news on this topic