promptunit

Measure AI Crawler Cost vs Value Before You Block

Before you block GPTBot, ClaudeBot or PerplexityBot, find out what they really cost you and what they bring back. This prompt turns your server logs and analytics into a simple keep, limit or block decision for each AI bot, backed by numbers instead of guesses.

Works in ChatGPTClaudeGemini659 words7 inputs to fillSEO-028

Example input

This is exactly what we gave the model. You replace it with your own details.

- Website: https://www.example.org (DIY home repair guides)
- Business model: Ad-supported publisher with affiliate links to tools
- Server log access and format: 30 days of Cloudflare logs (exported as CSV)
- Hosting, CDN plan and cost info: Cloudflare Pro plan. The bandwidth bill went up 35% in 6 months, and the site slowed down twice during heavy crawling.
- Analytics tool: GA4. Last 30 days: 1,840 sessions from chatgpt.com, 410 from perplexity.ai, 95 from gemini.google.com, 60 from claude.ai. Engagement rate from ChatGPT visitors is 71% vs 58% site average.
- Topics or pages that matter most to my business: Plumbing repair guides, electrical safety guides, tool reviews
- Optional: paste a sample of log lines or a summary table of bot hits:
Bot hits, last 30 days (all bots = 100%):
Googlebot 31%
Bytespider 14%
GPTBot 11%
ClaudeBot 8%
Meta-ExternalAgent 7%
Amazonbot 5%
PerplexityBot 4%
OAI-SearchBot 3%
Bingbot 3%
ChatGPT-User 2%
Others 12%
Top sections for GPTBot: /plumbing/ 38%, /tools/reviews/ 27%. Bytespider spreads across the whole site including /tag/ and ?page= URLs.

Real output

Pasted straight from the model. We did not fix a word.

Before we start: 5 quick questions (I used my best guess for each)

  1. Who sends the bandwidth bill that went up 35%? Guess: your origin host, not Cloudflare. Cloudflare doesn't charge per GB of normal CDN traffic on Pro, unless you added a metered add-on such as Argo. So the real cost is bot requests that miss Cloudflare's cache and reach your server.
  2. What are the column names in your CSV? Guess: Cloudflare's standard log field names (ClientRequestUserAgent, ClientRequestURI, EdgeResponseStatus, EdgeResponseBytes, CacheCacheStatus, EdgeStartTimestamp, ClientIP). You can change them in one place in the script.
  3. What counts as a conversion for you? Guess: an affiliate link click, tracked as a GA4 key event. You didn't share conversion numbers, so for now the scorecard uses engagement.
  4. Is any content paid, gated or private? Guess: no. All guides and reviews are public, so "sensitive content" doesn't drive any decision below.
  5. Do you want your content in AI training data, in the hope of brand mentions later? Guess: no. So I follow your default rule: training crawlers with a high cost get Block.

1. Measurement plan

Step 1: Confirm bot names first (and every quarter)

Bot names change. Before you run the script or publish any rule, check each vendor's crawler docs. Then update the script's BOTS list, your robots.txt and the WAF rule.

  • OpenAI (GPTBot, OAI-SearchBot, ChatGPT-User): platform.openai.com/docs/bots
  • Anthropic (ClaudeBot, Claude-SearchBot, Claude-User): Anthropic's help-center article about its web crawlers
  • Perplexity (PerplexityBot, Perplexity-User): docs.perplexity.ai/guides/bots
  • Google (Googlebot, plus Google-Extended, which is only a robots.txt token and never shows up in logs): developers.google.com/search/docs/crawling-indexing/overview-google-crawlers
  • Meta (meta-externalagent, meta-externalfetcher, facebookexternalhit): developers.facebook.com/docs/sharing/webmasters/web-crawlers
  • Amazon (Amazonbot): developer.amazon.com/amazonbot
  • ByteDance (Bytespider): I don't know of a reliable official page, so go by your logs.
  • Common Crawl (CCBot): commoncrawl.org

These are the links as I last knew them. If one has moved, search the vendor's site. What I say below about how each bot treats robots.txt is also from vendor docs as I last saw them, so check that too.

Step 2: Get the cost facts from your hosting team

Send them these questions:

  1. How many GB did the origin send, and what did it cost, each month for the last 6 months? (The bill went up 35%, and I want to know how much of that is bots.)
  2. For the two slowdowns: what were the exact dates and times, and what ran out (CPU, PHP workers, database, bandwidth)?
  3. Do your server logs show which user agents were hitting us during those windows?
  4. Are /tag/ and ?page= pages served from Cloudflare's cache, or built fresh by the server every time?
  5. Are we close to any limit on our hosting plan (requests, CPU, GB)?

Step 3: Run the script on your 30 days of Cloudflare CSV

Save it as ai_bot_report.py, put your CSV files in a folder (for example cloudflare_export/) and run: python3 ai_bot_report.py "cloudflare_export/*.csv"

For each bot it counts hits, share of hits, GB sent, how much reached your server (the real cost), crawl-trap share, sections, status codes and peak request rates. It also writes an hourly table so you can match the slowdowns.

#!/usr/bin/env python3
"""
ai_bot_report.py - per-bot hits, bandwidth, origin load, sections and status codes
from Cloudflare logs exported as CSV.

Run:    python3 ai_bot_report.py "cloudflare_export/*.csv"
Needs:  Python 3.8+ (no extra packages)
Output: a summary on screen + 5 CSV files in ./bot_report/
"""
import csv
import glob
import os
import re
import sys
from collections import Counter, defaultdict
from datetime import datetime, timezone
from urllib.parse import urlsplit

csv.field_size_limit(2**31 - 1)
OUT = "bot_report"
HUMAN = "Not a bot (people + unknown)"

# 1) Your CSV column names. First match wins, any letter case. Edit if yours differ.
COLUMNS = {
    "ua":        ["ClientRequestUserAgent", "User agent", "UserAgent"],
    "uri":       ["ClientRequestURI", "ClientRequestPath", "Path", "URL"],
    "status":    ["EdgeResponseStatus", "Status", "Response code"],
    "bytes":     ["EdgeResponseBytes", "Bytes"],
    "cache":     ["CacheCacheStatus", "Cache status"],
    "time":      ["EdgeStartTimestamp", "Timestamp", "Datetime"],
    "ip":        ["ClientIP", "Source IP", "IP"],
    "origin_ms": ["OriginResponseDurationMs"],
}

# 2) Bots: (name, owner, user-agent pattern). Confirm names in each vendor's docs.
#    Google-Extended and Applebot-Extended are robots.txt tokens only: never in logs.
BOTS = [
    ("GPTBot", "OpenAI", r"GPTBot"),
    ("OAI-SearchBot", "OpenAI", r"OAI-SearchBot"),
    ("ChatGPT-User", "OpenAI", r"ChatGPT-User"),
    ("ClaudeBot", "Anthropic", r"ClaudeBot"),
    ("Claude-SearchBot", "Anthropic", r"Claude-SearchBot"),
    ("Claude-User", "Anthropic", r"Claude-User"),
    ("PerplexityBot", "Perplexity", r"PerplexityBot"),
    ("Perplexity-User", "Perplexity", r"Perplexity-User"),
    ("Bytespider", "ByteDance", r"Bytespider"),
    ("meta-externalagent", "Meta", r"meta-externalagent"),
    ("meta-externalfetcher", "Meta", r"meta-externalfetcher"),
    ("facebookexternalhit", "Meta", r"facebookexternalhit"),
    ("Amazonbot", "Amazon", r"Amazonbot"),
    ("Applebot", "Apple", r"Applebot"),
    ("CCBot", "Common Crawl", r"CCBot"),
    ("DuckAssistBot", "DuckDuckGo", r"DuckAssistBot"),
    ("MistralAI-User", "Mistral", r"MistralAI-User"),
    ("Googlebot", "Google", r"Googlebot"),
    ("Bingbot", "Microsoft", r"bingbot"),
]
BOT_RE = [(n, o, re.compile(p, re.I)) for n, o, p in BOTS]
ANY_BOT = re.compile(r"bot|crawl|spider|slurp|fetcher", re.I)

# 3) Your sections (guess - edit to your real folders). Longest match wins.
SECTIONS = sorted(["/plumbing/", "/electrical/", "/tools/reviews/", "/tools/", "/tag/"],
                  key=len, reverse=True)
TRAP_PATH = re.compile(r"^/tag/|/page/\d+", re.I)      # low-value crawl traps
TRAP_QUERY = re.compile(r"(^|&)page=", re.I)
TO_ORIGIN = {"miss", "expired", "bypass", "dynamic", "revalidated"}  # reached your server


def pick(fields, key):
    lookup = {f.strip().lower(): f for f in fields}
    return next((lookup[c.lower()] for c in COLUMNS[key] if c.lower() in lookup), None)


def val(row, col):
    return (row.get(col) or "").strip() if col else ""


def classify(ua):
    for name, owner, rx in BOT_RE:
        if rx.search(ua):
            return name, owner
    return ("Other bot", "?") if ANY_BOT.search(ua) else (HUMAN, "-")


def split_url(raw):
    try:
        u = urlsplit(raw or "/")
        return u.path or "/", u.query
    except ValueError:
        return "/", ""


def section(path):
    for s in SECTIONS:
        if path.startswith(s):
            return s
    parts = [p for p in path.split("/") if p]
    if not parts:
        return "/ (home)"
    return "/" + parts[0] + "/" if len(parts) > 1 else "(top-level page or file)"


def minute(ts):
    if not ts:
        return None
    if ts.isdigit():  # Unix time in s, ms, us or ns
        n = int(ts)
        n = n / 1e9 if n > 1e17 else n / 1e6 if n > 1e14 else n / 1e3 if n > 1e11 else n
        return datetime.fromtimestamp(n, tz=timezone.utc).strftime("%Y-%m-%d %H:%M")
    return ts.replace("T", " ")[:16]


def pct(a, b):
    return round(100.0 * a / b, 1) if b else 0.0


def to_int(s):
    try:
        return int(float(s or 0))
    except ValueError:
        return 0


def main(patterns):
    files = sorted({f for p in patterns for f in glob.glob(p)})
    if not files:
        sys.exit('No CSV files found. Run: python3 ai_bot_report.py "cloudflare_export/*.csv"')
    hits, sent, o_hits, o_bytes, traps = (Counter() for _ in range(5))
    ms_sum, ms_n, other_uas, owners, missing = Counter(), Counter(), Counter(), {}, set()
    sections, statuses = defaultdict(Counter), defaultdict(Counter)
    per_hour, per_min, per_ip_min = defaultdict(Counter), defaultdict(Counter), defaultdict(Counter)

    for path in files:
        with open(path, newline="", encoding="utf-8-sig", errors="replace") as fh:
            rows = csv.DictReader(fh)
            col = {k: pick(rows.fieldnames or [], k) for k in COLUMNS}
            if not (col["ua"] and col["uri"]):
                sys.exit(f"{path}: no user-agent or URL column. Edit COLUMNS. Found: {rows.fieldnames}")
            missing |= {k for k, c in col.items() if not c}
            for r in rows:
                ua = val(r, col["ua"])
                bot, owner = classify(ua)
                owners[bot] = owner
                hits[bot] += 1
                if bot == "Other bot":
                    other_uas[ua[:200]] += 1
                page_path, query = split_url(val(r, col["uri"]))
                sections[bot][section(page_path)] += 1
                if TRAP_PATH.search(page_path) or TRAP_QUERY.search(query):
                    traps[bot] += 1
                statuses[bot][val(r, col["status"]) or "?"] += 1
                size = to_int(val(r, col["bytes"]))
                sent[bot] += size
                if val(r, col["cache"]).lower() in TO_ORIGIN:
                    o_hits[bot] += 1
                    o_bytes[bot] += size
                    ms = to_int(val(r, col["origin_ms"]))
                    if ms > 0:
                        ms_sum[bot] += ms
                        ms_n[bot] += 1
                m = minute(val(r, col["time"]))
                if m:
                    per_hour[bot][m[:13]] += 1
                    if bot != HUMAN:
                        per_min[bot][m] += 1
                        ip = val(r, col["ip"])
                        if ip:
                            per_ip_min[bot][(ip, m)] += 1

    os.makedirs(OUT, exist_ok=True)
    total = sum(hits.values())
    bot_total = total - hits[HUMAN]
    all_origin = sum(o_bytes.values())
    order = [b for b, _ in hits.most_common()]

    def save(name, header, data):
        with open(os.path.join(OUT, name), "w", newline="", encoding="utf-8") as fh:
            w = csv.writer(fh)
            w.writerow(header)
            w.writerows(data)

    summary = []
    for b in order:
        n, st = hits[b], statuses[b]
        summary.append([
            b, owners[b], n, pct(n, total), "" if b == HUMAN else pct(n, bot_total),
            round(sent[b] / 1e9, 2), pct(o_hits[b], n), round(o_bytes[b] / 1e9, 2),
            pct(o_bytes[b], all_origin), pct(traps[b], n),
            pct(sum(v for k, v in st.items() if k.startswith("4")), n),
            pct(sum(v for k, v in st.items() if k.startswith("5")), n),
            max(per_min[b].values(), default=0), max(per_ip_min[b].values(), default=0),
            round(ms_sum[b] / ms_n[b]) if ms_n[b] else "",
        ])
    save("bot_summary.csv",
         ["bot", "owner", "hits", "pct_all_hits", "pct_bot_hits", "gb_sent", "pct_to_origin",
          "origin_gb", "pct_all_origin_gb", "pct_crawl_traps", "pct_4xx", "pct_5xx",
          "peak_req_per_min", "peak_req_per_min_one_ip", "avg_origin_ms"], summary)
    save("bot_sections.csv", ["bot", "section", "hits", "pct_of_bot"],
         [[b, s, c, pct(c, hits[b])] for b in order for s, c in sections[b].most_common(15)])
    save("bot_status.csv", ["bot", "status", "hits", "pct_of_bot"],
         [[b, s, c, pct(c, hits[b])] for b in order for s, c in statuses[b].most_common()])
    hours = sorted({h for counts in per_hour.values() for h in counts})
    save("hourly.csv", ["hour"] + order, [[h] + [per_hour[b][h] for b in order] for h in hours])
    save("other_bots.csv", ["user_agent", "hits"], other_uas.most_common(50))

    print(f"\n{len(files)} file(s), {total:,} rows, {bot_total:,} bot rows")
    if missing:
        print("Columns not found, so those numbers show 0:", ", ".join(sorted(missing)))
    print(f"\n{'Bot':<22}{'% bot hits':>11}{'GB sent':>9}{'% origin GB':>12}{'% traps':>9}{'% 4xx':>7}")
    for row in summary:
        if row[0] != HUMAN:
            print(f"{row[0]:<22}{row[4]:>11}{row[5]:>9}{row[8]:>12}{row[9]:>9}{row[10]:>7}")
    print(f"\nSaved in ./{OUT}/: bot_summary, bot_sections, bot_status, hourly, other_bots (.csv)")


if __name__ == "__main__":
    main(sys.argv[1:])

How to read the output

  • Cost comes from pct_all_origin_gb and peak_req_per_min. The first is each bot's share of the bytes your server had to send, which is what your bandwidth bill follows. The second shows spikes, which are what slow the site.
  • pct_bot_hits should roughly match your table (for example Bytespider about 14%). If it doesn't, your export is missing rows or the column names are off.
  • pct_crawl_traps high means the bot is spending your server on /tag/ and ?page= pages. Expect this for Bytespider.
  • Status codes: many 404s mean the bot is crawling dead URLs. 5xx means it is hurting your server. 403s after your new rules mean the block works.
  • other_bots.csv breaks down your 12% "Others". Any AI agent above about 1% of bot hits gets its own row and decision.
  • User agents can be faked. If a blocked bot's numbers look odd, cross-check against Cloudflare's own bot analytics, which verify the big crawlers.

Step 4: Match the two slowdowns

Get the two slowdown windows from your host (Step 2). Open hourly.csv in Google Sheets, find those hours and compare each bot's column with its normal hour. The bot that spikes in both windows is your main cost suspect. My guess is Bytespider, because it crawls the whole site including /tag/ and ?page= pages, but let the data decide. If your export has OriginResponseDurationMs, avg_origin_ms shows which bots hit slow, uncached pages.

Step 5: GA4 referrals and visitor quality

  • Go to Explore > Free form. Rows: Session source, then Landing page + query string. Values: Sessions, Engaged sessions, Engagement rate, Views per session, Key events (your affiliate click) and Session key event rate.
  • Filter: Session source partially matches regex chatgpt\.com|openai\.com|perplexity\.ai|gemini\.google\.com|claude\.ai|copilot\.microsoft\.com|meta\.ai This also catches Perplexity, which the built-in AI channel may miss. Add Organic Search as a comparison.
  • Value per platform (fill in your own numbers): ad value ≈ sessions × views per session × page RPM ÷ 1,000 affiliate value ≈ affiliate clicks × average earnings per click
  • Landing pages: if ChatGPT visitors land on /plumbing/ and /tools/reviews/, that matches GPTBot's crawl focus (38% and 27%). It confirms these are the pages AI platforms value most, so make sure OAI-SearchBot and PerplexityBot get 200s there (check bot_status.csv).
  • You already know ChatGPT visitors engage at 71% against a 58% site average. That makes ChatGPT your best AI channel even at 1,840 sessions.
  • GA4 only shows platforms that send visitors. A zero here for Bytespider, Meta and Amazon means "no sign of value". It is not proof of no value.

Step 6: Citations, mentions and accuracy

  • Write 20 prompts your readers really ask: 6 plumbing, 6 electrical safety, 6 tool reviews and 2 with your brand name. For example: "how to fix a running toilet", "is it safe to replace a light switch myself", "best cordless drill for home repairs".
  • Run each prompt in ChatGPT (with search on), Perplexity, Gemini and Claude. Also run them in Meta AI to test the Meta decision. Run each one twice, because answers vary.
  • For each answer, record: cited with a link (Y/N), brand mentioned (Y/N), accurate compared with your guide (Y/N), and which competitors were cited.
  • Check electrical safety first. A wrong safety answer with your name attached is a real risk. Report it with the platform's feedback button, and make any unclear wording on your page clearer.

Step 7: Decide, roll out and re-measure after 4 weeks

  • Day 1: publish the robots.txt and the WAF block rule (Section 3).
  • Day 2: check Security > Events. Only the 6 blocked bots should show up.
  • Week 4: run the script and the GA4 report again. Success means:
    • blocked bots' 2xx hits are near zero
    • origin GB is down
    • there have been no more slowdowns
    • chatgpt.com and perplexity.ai sessions are steady
  • OAI-SearchBot hits may rise a little after you block GPTBot. As I recall, OpenAI's docs say it may use one crawl for both bots when both are allowed. The size of any rise is a guess, and it is fine.
  • If AI referral sessions fall by more than about 20% with no other cause, look at the decisions again before the quarter ends.

2. Scorecard

How to read it:

  • Share of hits is the share of all bot hits, from your table.
  • Cost uses my own cut-offs, which are a guess until you run the script: High = 8% or more of bot hits, Medium = 5–7%, Low = 4% or less. Swap in pct_all_origin_gb once you have it.
  • "—" means it isn't in your data yet. The script fills it in.
  • The one-line reason for each recommendation is in the Decision column.
BotOwnerShare of hitsTop sectionsReferrals (30 days)ConversionsCostDecision
BytespiderByteDance14%Whole site, incl. /tag/ and ?page=0 seenNone seenHigh: biggest AI crawler, mostly low-value URLs that likely miss the cache (guess)Block (robots.txt + WAF): highest cost and no sign of value. It is widely reported to ignore robots.txt, so the WAF rule does the real work
GPTBotOpenAI11%/plumbing/ 38%, /tools/reviews/ 27%0 direct (training crawler)None directHigh: it crawls your two money sectionsBlock: training only, so its value is indirect or in the future (your default rule). Your 1,840 ChatGPT visits come through OAI-SearchBot and ChatGPT-User, which stay open
ClaudeBotAnthropic8%—0 direct (training crawler)None directHighBlock: training only. The 60 claude.ai visits come through Claude-SearchBot and Claude-User, which stay open
meta-externalagentMeta7%—0 seen (no meta.ai in GA4)None seenMediumBlock: AI training and indexing with no sign of visitors. Keep facebookexternalhit so link previews still work when people share your guides
AmazonbotAmazon5%—0 seenNone seenMediumBlock: no referrals. Amazon's assistants mostly send shoppers to Amazon, not to your tool reviews (guess)
PerplexityBotPerplexity4%—410 perplexity.ai (shared with Perplexity-User)Not givenLowKeep: your 2nd-biggest AI referrer for a small crawl. A safety-net rate limit only
OAI-SearchBotOpenAI3%—1,840 chatgpt.com (shared with ChatGPT-User)Not given. Engagement 71% vs 58% site averageLowKeep: it puts you in ChatGPT search answers, your biggest and best-engaged AI channel
ChatGPT-UserOpenAI2%—Part of the 1,840Same visitors as aboveLowKeep: it fetches your page when a ChatGPT user asks about it. Low cost, direct value (OpenAI says robots.txt may not apply to it)
Perplexity-UserPerplexityIn "Others" (check)—Part of the 410Not givenLow (guess)Keep: user-triggered. Perplexity says it generally ignores robots.txt, so only a WAF rule could stop it, and you don't want to
Claude-SearchBot, Claude-UserAnthropicIn "Others" (check)—60 claude.aiNot givenLow (guess)Keep: few visitors, but real ones, for almost no crawl
Google-Extended (robots.txt token, not a crawler)Google0%: Googlebot does the fetching—95 gemini.google.comNot givenNone extraKeep: no crawl cost, and blocking it may cut Gemini grounding and citations
CCBotCommon CrawlIn "Others" (check)—0NoneUnknownBlock (provisional): only builds a training dataset and sends no visitors. Confirm it shows up in your logs
Other AI agents (e.g. Applebot, DuckAssistBot, MistralAI-User, meta-externalfetcher)VariousPart of the 12% "Others"—0 seenNone seenLow (guess)Limit/watch: unclear value and low cost. Decide next quarter with real numbers
GooglebotGoogle31%—Organic search—Not scoredKeep: out of scope, never blocked
BingbotMicrosoft3%—Bing and Copilot—Not scoredKeep: out of scope, never blocked

Bottom line: blocking the five training crawlers with high or medium cost removes about 45% of bot hits (14 + 11 + 8 + 7 + 5). Every bot that sends you visitors stays open. If origin bytes follow hits, this is your biggest lever on the bandwidth bill and the slowdowns. The script will confirm whether they do.


3. Rules

robots.txt: add this to the end of your current file. Keep your Sitemap line.

# ---------------------------------------------------------------
# AI crawlers - bot-by-bot decisions for www.example.org
# Decided 2026-11-29 - next review 2027-02-28
# Confirm every token in the vendor's docs before publishing.
#
# Leave your existing "User-agent: *" group exactly as it is.
# Do NOT add Googlebot or Bingbot groups: a bot with its own group
# ignores the * group, which could change how they crawl.
#
# KEEP (no group needed - they follow your * rules):
#   OAI-SearchBot, ChatGPT-User, PerplexityBot, Perplexity-User,
#   Claude-SearchBot, Claude-User, Google-Extended, Applebot,
#   facebookexternalhit
# ---------------------------------------------------------------

# BLOCK - high crawl cost, value only indirect (training) or none seen
User-agent: Bytespider
Disallow: /

User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: meta-externalagent
Disallow: /

User-agent: Amazonbot
Disallow: /

# BLOCK (provisional) - confirm it appears in your logs
User-agent: CCBot
Disallow: /

# LIMIT (template, NOT active) - use only if a Keep bot spends more than
# 10% of its hits on crawl traps. With its own group it ignores "*",
# so copy your existing * rules into this group too.
# User-agent: PerplexityBot
# Disallow: /tag/
# Disallow: /*?page=
# Disallow: /*&page=

Cloudflare rules: in the dashboard, go to Security > WAF.

# ---- Custom rule (Security > WAF > Custom rules > Create rule) ----
# Name: Block AI training crawlers (reviewed 2026-11-29)
# Expression (use "Edit expression"):
(lower(http.user_agent) contains "bytespider"
  or lower(http.user_agent) contains "gptbot"
  or lower(http.user_agent) contains "claudebot"
  or lower(http.user_agent) contains "meta-externalagent"
  or lower(http.user_agent) contains "amazonbot"
  or lower(http.user_agent) contains "ccbot")
and http.request.uri.path ne "/robots.txt"
# Action: Block
# /robots.txt stays open so the bots that obey it can read your Disallow and stop.
# Blocked requests stop at Cloudflare, so they no longer cost your origin anything.

# ---- Rate limiting rule (Security > WAF > Rate limiting rules) ----
# Name: AI search crawler safety net (Keep bots - only cuts spikes)
# If incoming requests match:
(http.user_agent contains "PerplexityBot"
  or http.user_agent contains "OAI-SearchBot"
  or http.user_agent contains "Claude-SearchBot")
# With the same characteristics: IP
# When rate exceeds: 120 requests per 1 minute
#   (guess - set it to 2x "peak_req_per_min_one_ip" from the script)
# Then: Block, for 1 minute
# Do NOT rate-limit ChatGPT-User, Perplexity-User or Claude-User:
# they fetch pages for real people who are asking about your content.

# ---- Template, NOT active: user-triggered fetchers ----
# robots.txt may not stop these, so a WAF rule is the only real control.
# Use only if you later decide to block one, for example:
# lower(http.user_agent) contains "perplexity-user"    -> Action: Block

Plan check (Cloudflare Pro)

  • WAF custom rules: included on Pro. I believe Pro allows 20 custom rules, and this uses 1.
  • Rate limiting rules: included on Pro, but I'm not sure of your exact limits. I believe Pro gets 2 rules that count by IP only, with short periods (10 seconds or 1 minute). If "1 minute" isn't offered, pick the closest option.
  • lower() in expressions: I'm fairly sure this works on all plans. If the editor rejects it, use the exact casing instead, for example http.user_agent contains "Bytespider".
  • Testing: as far as I know, the "Log" action is Enterprise-only. On Pro, deploy the Block rule and watch Security > Events for 48 hours to check that it only hits the intended bots.
  • Super Bot Fight Mode: included on Pro. If you use it, keep "Verified bots" set to Allow, or you would block Googlebot and Bingbot.
  • One-click "Block AI bots" setting and Cloudflare's managed robots.txt: both are available on all plans. Leave them off. They treat AI bots as one group, which breaks your bot-by-bot rule and could catch bots you keep, such as OAI-SearchBot or PerplexityBot.
  • AI Crawl Control: I believe this is on all plans, Pro included, but I'm not sure which reports Pro gets. Use it to cross-check the script's numbers. Don't use it as a second place to set blocks.
  • Cache Rules: included on Pro. If pct_to_origin is high for the bots you keep (and for Googlebot) on /tag/ and paginated pages, a cache rule for those URLs can cut server load without blocking anyone. Test it on a few URLs first.

4. Quarterly review checklist

Review date: ________ Reviewer: ________ Next review: ________ (first one: 2027-02-28)

Data

  • Confirm current bot names in each vendor's docs. Update BOTS, robots.txt and the WAF rule for any new or renamed agent.
  • Export the last 30 days of Cloudflare logs, run ai_bot_report.py and save bot_report/ in a dated folder.
  • Check other_bots.csv: any new AI agent above about 1% of bot hits gets a row and a decision.

Cost

  • Compare origin GB and the bandwidth bill with last quarter (baseline: +35% over the 6 months to Nov 2026).
  • Any slowdowns this quarter? Match their times to hourly.csv.
  • Are blocked bots' 2xx hits near zero? If you still see 200s, it's a new name, a faked user agent or a broken rule.
  • In Security > Events, check that the block rule and the rate-limit rule only hit the intended bots.

Value

  • Compare GA4 AI referrals with the baseline (30 days, Nov 2026): chatgpt.com 1,840 · perplexity.ai 410 · gemini.google.com 95 · claude.ai 60. ChatGPT engagement was 71% vs a 58% site average.
  • Check affiliate clicks and views per session for each AI source.
  • Are AI visitors still landing on /plumbing/, the electrical safety guides and /tools/reviews/?
  • Run the citation test again: same 20 prompts, same platforms. Record cited, mentioned, accurate and competitors cited.
  • Electrical safety answers: is any wrong advice tied to your brand? Report it and make your page clearer.
  • Future potential: is any platform growing fast, or has a blocked vendor started sending visitors?

Search engines (never blocked)

  • Search Console: robots.txt report is fine and Googlebot crawl stats are steady.
  • Bing Webmaster Tools: Bingbot crawl is steady.

Decide

  • Fill in the table below. Move bots between Keep, Limit and Block using the same decision rules.
  • Note each change with its date and reason, and set the next review date.
BotShare of bot hits (last → now)Origin GB shareReferrals (last → now)Key eventsCitations (of 20)Decision (last → now)Reason
Bytespider14% →0 →—Block →
GPTBot11% →0 direct →Block →
ClaudeBot8% →0 direct →Block →
meta-externalagent7% →0 →(Meta AI test)Block →
Amazonbot5% →0 →Block →
CCBot? →0 →—Block (provisional) →
PerplexityBot + Perplexity-User4% + ? →410 →Keep →
OAI-SearchBot + ChatGPT-User3% + 2% →1,840 →Keep →
Claude-SearchBot + Claude-User? →60 →Keep →
Google-Extended (token)0% →095 →Keep →
Other AI agentspart of 12% →0 →Watch →

The prompt

First lines open so you can see how it is built. The rest opens after purchase.

the prompt · 659 words8 sections
#ROLE
You are a technical SEO and data analyst. Help me measure the real cost and value of each AI crawler on my site, then decide for each bot: keep, limit or block.

#INPUTS
Fill in every line. Leave a line blank if you don't know it.
- Website: [WEBSITE URL]
- Business model: [e.g., ad-supported publisher, store, SaaS, lead generation]
- Server log access and format: [e.g., 30 days of Apache/Nginx logs, Cloudflare logs, none]
Full prompt opens after purchase
Sections inside: #ROLE #INPUTS #HOW TO MEASURE #DECISION RULES #PROCESS #OUTPUT FORMAT #RULES #QUALITY CHECK

How to use it

  1. Buy, then open it in your account.
  2. Copy the prompt into ChatGPT, Claude or Gemini.
  3. Replace the 7 inputs with your product.
  4. Run it. Use the output. Re-run with a different tone if you like.

Pro tips

  • Use 30 days of logs if you can. Referral numbers alone miss bots that crawl but never send visitors.
  • Compare engagement, not just sessions. A small number of AI visitors can still be your best ones.
  • Review the decision every quarter. A bot that brings nothing today might bring a lot next year.

Before you buy

Will it work for my product?
Yes, if you can fill the 7 inputs. If the output is bad with your inputs, email us: we fix the prompt and refund you.
Do I download a file?
No. It lives in your account with a copy button, and updates when we improve it.
Which model is best?
Best on Claude. Works in ChatGPT, Claude and Gemini.

Works well with this

Prompts people use in the same campaign.

More in AI Search & Bots

See all in this sub-category

Buying more than two? Lifetime is cheaper.

Every prompt, every category, forever. $59 once. Nothing to download, nothing to renew.

Get lifetime · $59

This prompt

$3$7

  • ✓ Instant access in your account, with a copy button
  • ✓ Example input and real output included
  • ✓ 7-day money-back, no form

Or get every prompt, forever

Lifetime Access · $59 $149 — all categories, all future prompts, rewrites included.

Get lifetime access

Card or PayPal · taxes at checkout · nothing to download

Not the one you need?

Browse every prompt by category and sub-category.

Browse all prompts
Lifetime $59 →