Not every visitor to your site is a human. A significant portion of your server's traffic is automated: search engine crawlers, AI training bots, monitoring services, scrapers, and malicious actors all send HTTP requests to your pages. Managing this traffic intelligently — letting good bots in efficiently, rate-limiting or blocking harmful ones, and verifying who is actually who — is an advanced operational SEO skill that directly affects crawl budget, server stability, security, and ultimately, your indexed footprint.
This module covers how to distinguish legitimate crawlers from imposters, how to manage the growing wave of AI bots, how to rate-limit aggressive crawlers without accidentally hurting Googlebot, and how to build a coherent bot-management strategy grounded in logs and evidence rather than guesswork.
Your server logs contain a richer view of your site's audience than Google Search Console ever will. When you open those logs, you will typically find traffic from several broad categories of automated agents:
User-Agent to "Googlebot" but are not actually Google. This is one of the most important things to detect.Your first job is to segment these categories in your logs before making any policy decisions. Acting on raw bot traffic without segmentation is how sites accidentally block Googlebot or waste engineering time on the wrong problem.
Any bot can claim to be Googlebot by setting its User-Agent header. Before you make access decisions based on a bot's identity, you must verify that it actually is who it claims to be. Google's official verification method is reverse DNS lookup followed by forward DNS confirmation.
The steps are:
host <IP> or nslookup <IP>). A genuine Googlebot IP will resolve to a hostname ending in .googlebot.com or .google.com.# Reverse lookup example (Linux/macOS terminal)
host 66.249.66.1
# Should return something like:
# 1.66.249.66.in-addr.arpa domain name pointer crawl-66-249-66-1.googlebot.com.
# Forward lookup to confirm
host crawl-66-249-66-1.googlebot.com
# Should return:
# crawl-66-249-66-1.googlebot.com has address 66.249.66.1
If the forward DNS result does not match the original IP, the request is from an impersonator. Google publishes its full crawler IP ranges in its Googlebot IP JSON file, which you can also use for automated allowlisting.
Other major crawlers follow similar patterns:
*.search.msn.com*.apple.com or *.applebot.apple.com
Build this verification step into any automated bot-management rule that acts on crawler identity. A robots.txt rule or firewall rule based only on User-Agent string is not a security control — it is a courtesy signal. Real enforcement requires IP-level verification.
Effective bot management starts with measurement. Before writing a single firewall rule, spend time in your logs understanding the actual traffic composition.
Key metrics to extract per bot:
A quick command-line breakdown of bot traffic from an Apache/nginx combined log:
# Count requests by User-Agent (top 20)
cat access.log | awk -F'"' '{print $6}' | sort | uniq -c | sort -rn | head -20
# Count total requests from known Googlebot IPs (example range)
grep "66.249" access.log | wc -l
# Find all unique IPs claiming to be Googlebot
grep -i "googlebot" access.log | awk '{print $1}' | sort -u
# See what URLs a specific bot is hitting
grep "Googlebot" access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -30
This analysis frequently surfaces surprises: scrapers burning through thousands of requests per hour, SEO tools crawling staging environments, or Googlebot repeatedly hitting redirected URLs that should have been cleaned up months ago.
The robots.txt Robots Exclusion Protocol is a cooperative agreement, not an access control mechanism. Legitimate, well-behaved crawlers respect it. Malicious scrapers and most spam bots ignore it entirely.
Understanding this distinction shapes your entire bot-management approach:
robots.txt to direct the crawl budget of compliant crawlers — Googlebot, Bingbot, Applebot — toward your high-value pages.robots.txt to block scrapers or malicious bots. They will not honor it.robots.txt with the intent of hiding them — a disallow entry is publicly readable and effectively a directory of your "hidden" paths.The appropriate tools for actually blocking bots are your web server configuration, CDN/WAF rules, and firewall policies — not the Robots Exclusion Protocol.
Since 2023, a new category of high-volume bot has emerged: AI training crawlers operated by OpenAI, Anthropic, Google (for AI products distinct from Search), Meta, Apple, and others. These differ from search engine crawlers in one critical way: they provide no referral traffic or ranking benefit in return for indexing your content. The decision to allow or block them is a content licensing and business decision.
The major AI crawlers and their documented User-Agent tokens:
GPTBot — OpenAI (training data for GPT models)ClaudeBot — AnthropicGoogle-Extended — Google's Bard/Gemini AI training (separate from Googlebot for Search)CCBot — Common Crawl (used by many AI companies as a data source)Meta-ExternalAgent — Meta AIApplebot-Extended — Apple AI featuresDiffbot — AI-powered data extractionFacebookBot — Meta (for AI training, distinct from social link preview)
To block all AI training crawlers while preserving Search crawler access, you can add disallow rules per bot in robots.txt:
# Block OpenAI's training crawler
User-agent: GPTBot
Disallow: /
# Block Anthropic's training crawler
User-agent: ClaudeBot
Disallow: /
# Block Google's AI training (NOT Googlebot — search crawling is unaffected)
User-agent: Google-Extended
Disallow: /
# Block Common Crawl
User-agent: CCBot
Disallow: /
# Standard Googlebot — full access (no rule needed if you want unrestricted)
User-agent: Googlebot
Allow: /
Critical nuance: Google-Extended is entirely separate from Googlebot. Blocking Google-Extended does not affect Google Search indexing in any way. These are distinct User-Agent strings for distinct systems.
If you want to allow these crawlers but restrict them to specific content (e.g., allowing them on your blog but not your proprietary data or product catalog):
User-agent: GPTBot
Allow: /blog/
Disallow: /
Monitor whether these bots are respecting your robots.txt by cross-referencing your log data after adding the rules. Compliant AI crawlers should cease or reduce requests to disallowed paths within a few days.
Some legitimate crawlers (SEO tools, link checkers, authorized partners) and nearly all scrapers crawl too aggressively. Aggressive crawling can cause:
The Crawl-delay directive tells compliant bots to wait a specified number of seconds between requests. Googlebot does not honor Crawl-delay — instead, configure Googlebot's crawl rate through Google Search Console (Settings → Crawling). Most other compliant bots do respect it.
# Ask Bingbot to slow down
User-agent: Bingbot
Crawl-delay: 5
# Ask SEO tool crawlers to slow down
User-agent: AhrefsBot
Crawl-delay: 10
User-agent: SemrushBot
Crawl-delay: 10
Do not add Crawl-delay for Googlebot. If Googlebot is crawling too aggressively for your server capacity, use Search Console's crawl rate tool — it provides a proper feedback loop with Google's systems.
For crawlers that ignore Crawl-delay, implement rate limiting at the web server or CDN layer. Here is an nginx example that limits any single IP to a sustained rate of 10 requests per second with a burst allowance:
# nginx.conf — define a zone keyed by remote IP
http {
limit_req_zone $binary_remote_addr zone=bot_limit:10m rate=10r/s;
server {
location / {
# Apply limit with a burst of 20 requests, no delay on burst
limit_req zone=bot_limit burst=20 nodelay;
}
}
}
To exclude verified Googlebot IPs from rate limiting (so you do not accidentally throttle your most important crawler), use a geo or IP-mapping approach:
# Map Googlebot IP ranges to a "trusted" variable
geo $is_googlebot {
default 0;
66.249.64.0/19 1;
66.249.80.0/20 1;
# Add current ranges from Google's published IP JSON
}
server {
location / {
# Only apply the limit to non-Googlebot IPs
if ($is_googlebot = 0) {
limit_req zone=bot_limit burst=20 nodelay;
}
}
}
Keep the Googlebot IP ranges up to date by scripting against Google's published IP JSON.
If you run your site behind a CDN with a Web Application Firewall (Cloudflare, Fastly, AWS CloudFront + WAF, Akamai), this is often the most practical place to manage bot traffic:
The configuration interface differs per CDN, but the principle is the same: apply the most permissive policy to verified good bots, rate-limit unknown bots, and block or challenge confirmed malicious actors.
Malicious bots — vulnerability scanners, content scrapers used for plagiarism or competitive intelligence, credential stuffers, form spammers — should be blocked at the firewall or CDN level, not via robots.txt.
Signals that identify a malicious or abusive bot (as opposed to a legitimate one):
wp-login.php, /admin, /.env, /xmlrpc.php, or other attack surface URLspython-requests, curl, libwww-perl, blank User-Agent)robots.txtAccept, Accept-Language, or other normal browser headers
For confirmed bad actors, a hard IP block or IP range block at the firewall level (iptables, Cloudflare IP Access Rules, AWS Security Groups) is appropriate. For high-volume scrapers that are not clearly malicious but are wasteful, a 429 Too Many Requests response with a Retry-After header is a measured response that rate-limits without a full block.
# nginx: return 429 for rate-limited requests instead of 503
limit_req_status 429;
# And set Retry-After in the response (via add_header)
add_header Retry-After 60;
One of the most consequential bot-management errors is applying a firewall rule that blocks all traffic claiming to be Googlebot — typically in an attempt to block fake Googlebots — and accidentally blocking the real ones too.
The correct approach has two steps and must be performed in this order:
Never write a rule of the form "block all traffic with User-Agent containing Googlebot." This will catch both the fake and the real, and removing yourself from Google's index is a much worse outcome than the scrapers you were trying to stop.
Cloaking — deliberately serving different content to search engine crawlers than to users — is a violation of Google's Webmaster Guidelines and can result in a manual action. However, there are legitimate cases where bots and users receive technically different responses:
If you implement any bot-specific behavior, document it carefully and be able to justify it as content-neutral. The line between "legitimate rendering optimization" and "cloaking" is the fidelity of the content delivered to the crawler versus the user.
Bot management is not purely a security or infrastructure concern — it has a direct crawl budget implication. Every request Googlebot makes to your server is a slot in your crawl budget. When your server responds slowly to Googlebot (because it is also handling thousands of scraper requests simultaneously), Googlebot self-throttles to avoid overloading your server. The result: fewer pages crawled, slower discovery of new or updated content.
Blocking or rate-limiting aggressive non-Google bots at the CDN or firewall layer — before they reach your origin — keeps your server healthy and fast for Googlebot. This is a direct crawl-budget optimization strategy, not just a server operations concern.
Verify the impact by comparing your server's average response time for Googlebot requests (from your logs) before and after implementing aggressive-bot rate limiting. Faster responses encourage Googlebot to crawl more frequently and deeply.
Rather than reacting to each new bot on a case-by-case basis, build a documented policy for your site or organization. A complete policy answers:
Treat this policy as a living document — the bot landscape changes quickly, and new AI crawler user agents appear regularly. Set a quarterly review cycle.
The worst outcome in bot management is accidentally blocking Googlebot and discovering it weeks later when rankings collapse. Build monitoring that catches this before it becomes an SEO incident:
GPTBot or Google-Extended does not affect your search rankings. Blocking Googlebot does.Obtain a real or sample server access log from a site you have access to (at least 24 hours of data). Complete the following:
robots.txt entries, nginx rate-limiting configuration, and (if applicable) CDN firewall rules that implement your policy.You have completed this milestone when you can present a documented bot management policy backed by log analysis, with every decision explained and every rule written out and tested in a staging environment.