Block AI Crawlers: Robots.txt or Server Level? SEO Guide

Share

Deciding to block AI crawlers is a business decision many search professionals are weighing. But once you’ve decided, what’s the most effective way to block those bots?

There are two main approaches to blocking crawlers: through robots.txt and at the server stack.

Two Ways To Block AI Crawlers

Both approaches have trade-offs. Let’s examine how each works and where they differ.

Blocking Through Robots.txt

Blocking AI crawlers with robots.txt is no different from blocking any other type of bot.

Each AI bot has a distinct identifying name—for instance, OpenAI’s GPTBot and OAI-SearchBot, or Anthropic’s ClaudeBot. To block them, add a disallow rule that names the crawler. For example, to stop GPTBot from crawling your entire site:

User-agent: GPTBot

Disallow: /

To block AI bots from only certain sections, specify the relevant folder:

User-agent: GPTBot

Disallow: /products/

Blocking At The Server Level

Server-level blocking can happen in three places: the origin server, the CDN, or the WAF.

With the server itself, the server reads the incoming request—such as the bot’s IP address or headers—and applies your configured rules (deny, allow, redirect). For example, you can configure the server to send GPTBot a “deny” response, preventing it from accessing your content.

A Content Delivery Network (CDN) applies similar logic but intercepts bot requests before they reach the origin server. This saves server bandwidth because the bot never actually touches your infrastructure. Some CDNs make this easy: Cloudflare, for instance, offers preset blocking based on whether a bot is a search crawler, an agent, or used for training, with options to tune rules per bot.

At the Web Application Firewall (WAF), bots face more scrutiny than at the CDN layer. The WAF acts as a security layer that analyzes request behavior, not just headers, so it can detect bots spoofing other user-agents. This makes it the most effective tool in most tech stacks for catching sophisticated AI crawlers attempting to evade standard blocks. Your WAF may be bundled with your CDN (e.g., Cloudflare WAF) or a standalone product like AWS WAF.

Robots.txt: Pros And Cons

Robots.txt is often the most accessible method for SEOs to control bots. Most SEOs can edit their domain’s robots.txt directly or request a quick change from the development team.

Beyond accessibility, there are other benefits.

Pros

Major, reputable AI companies officially support the robots.txt disallow mechanism. This includes OpenAI’s GPTBot and OAI-SearchBot, Anthropic’s ClaudeBot and Claude-SearchBot, Google’s Google-Extended, and Perplexity’s PerplexityBot.

This method also lets you selectively block specific pages and fine-tune rules per crawler.

Cons

The biggest risk is that robots.txt compliance is voluntary and not centrally enforced. AI bot creators may state that their bots respect robots.txt, but it’s a set of requests, not an actual block. Think of it as a no-trespassing sign in front of an open gate: nothing physically stops the bots, only their programming respects the rules.

When a CMS includes robots.txt controls, non-technical stakeholders can accidentally block more bots than intended with a single misconfigured rule. This can be catastrophic if someone implements a blanket disallow:

User-agent: *

Disallow: /

Robots.txt also isn’t automatically updated when new user agents are released. Someone must manually add new disallow rules each time you want to block a newly launched AI bot.

Server Stack: Pros And Cons

Blocking at the server, CDN, or WAF level offers different advantages depending on the implementation.

Pros

CDN and WAF blocks stop bot requests before they reach your server, saving bandwidth and reducing server strain and associated costs.

The biggest advantage of server-stack blocking is that it’s a hard stop. If robots.txt is a polite sign, the server, CDN, and WAF are a padlock on the gate. These methods don’t rely on crawler compliance—they detect and block bots whether or not the bots choose to follow robots.txt.

These tools also log blocked bot activity. The “padlock” records every attempt, which is useful for analyzing which bots are targeting your site. For sites receiving heavy unwanted AI traffic, this data can support discussions—sometimes legal ones—with the bot owners.

Cons

The primary downside is maintenance overhead. Most production servers are locked down, so only experienced developers typically have access to server files, WAF, or CDN configurations. This means changes often require a developer rather than being implemented directly by an SEO, adding time, resource, and cost—especially if a third-party agency manages your infrastructure.

Bot spoofing is also possible at each layer. Even the WAF—the strongest defense—can be bypassed by highly advanced bots that evade its validation checks. No server-stack method is completely foolproof against rogue AI crawlers, though they remain highly effective for most scenarios.

Which Should You Use?

There’s no single right answer. It depends on your website’s setup, budget, and management structure.

Ideally, you’d block bots at every layer of the server stack. The origin server can block known user-agents and detect simple behavioral patterns. CDN blocks are largely effective and keep bots from consuming server resources. The WAF is best at spotting spoofed bots and stopping advanced AI scrapers. However, you may not have convenient access to a WAF—or your site may not have one at all.

Robots.txt is the simplest way to signal that certain bots shouldn’t access your site, and it works for responsible bots. But because it can simply be ignored, treat it as a deterrent, not a prevention method.

If you have a strong need to block specific AI crawlers, implement the block as high in the server stack as possible: via the WAF if available, the CDN if not, and the server as a last resort.

If you only need to block one or two reputable AI crawlers, robots.txt may suffice as a deterrent. But monitor your server logs to check whether any bots are slipping past your disallow rules.

More Resources:


Featured Image: Paulo Bobita/Search Engine Journal

Read more