Skip to content
CitedByCheck my site freeFree check
Menu

Fail the deploy when AI crawlers see an empty page

A new framework version, a CDN rule or a client-side rewrite can leave OAI-SearchBot, GPTBot, ClaudeBot and PerplexityBot with a blocked or empty page, and nobody notices for weeks. This check requests your site with each bot's user-agent string and fails when the answer is not HTTP 200 with readable text. It runs on your machine or in your CI. It calls no AI model and sends nothing to CitedBy.

1. Save as ai-crawler-check.sh

#!/usr/bin/env bash
# Fails when AI crawlers get an error or an empty page from $1 (default: your deployed URL).
# Usage: ./ai-crawler-check.sh https://yourshop.com
set -u
URL="${1:?usage: ai-crawler-check.sh https://your-site}"
MIN_CHARS="${MIN_CHARS:-300}"
fail=0
check() {
  name="$1"; ua="$2"
  body="$(mktemp)"
  code="$(curl -sL -m 20 -A "$ua" -o "$body" -w '%{http_code}' "$URL")"
  chars="$(sed -e 's/<script[^>]*>.*<\/script>//g' -e 's/<[^>]*>/ /g' "$body" | tr -s '[:space:]' ' ' | wc -c | tr -d ' ')"
  rm -f "$body"
  if [ "$code" != "200" ]; then echo "FAIL $name: HTTP $code"; fail=1
  elif [ "$chars" -lt "$MIN_CHARS" ]; then echo "FAIL $name: only $chars readable characters (needs server-rendered HTML)"; fail=1
  else echo "ok   $name: HTTP 200, $chars readable characters"; fi
}
check OAI-SearchBot "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.3; +https://openai.com/searchbot"
check GPTBot "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.1; +https://openai.com/gptbot"
check ClaudeBot "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
check PerplexityBot "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)"
exit $fail

2. GitHub Action (.github/workflows/ai-crawlers.yml)

name: AI crawler check
on:
  deployment_status:   # runs after Vercel, Netlify or Render reports a deploy
  workflow_dispatch:
    inputs: {url: {description: Site URL, required: true}}
jobs:
  ai-crawlers:
    if: github.event_name == 'workflow_dispatch' || github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: bash ai-crawler-check.sh "${{ github.event.inputs.url || github.event.deployment_status.target_url }}"

3. Or run the open-source CitedBy check

The script above shows what the bots receive. citedby-check is an AI-search readiness check: citedby.eu loads your site from outside and reports whether robots.txt lets five AI-search crawlers in, whether the page text is in the raw HTML, Organization and Product data, and llms.txt, with the fix for each problem. Unlike the script, citedby-check sends the address to citedby.eu. Private and local addresses cannot be checked.

npx github:citedby-eu/citedby-check yourshop.com
- uses: citedby-eu/citedby-check@v0
  with:
    url: https://yourshop.com

It exits 1 when a check needs a fix and 3 when nothing could be measured (a rate limit, or your site refused the checker). In a workflow it writes the result to the job summary. Source, options and exit codes: github.com/citedby-eu/citedby-check.

Vercel, Netlify or any host

Run bash ai-crawler-check.sh https://your-site as a post-deploy step, or keep the workflow above: it fires on every successful deployment status.

What it cannot see

It sends the bots' user-agent strings from your runner. A firewall that verifies the vendors' IP ranges may treat the real bots differently, and it does not run JavaScript, which is also how the bots read your page.

Or call the API

The same crawler check is a free JSON API with no key: curl "https://citedby.eu/api/v1/ai-access?url=example.com". AI access API: fields, limits and OpenAPI spec

Crawl your site, up to your plan’s page limit, and get a fix for every issue, from €49.