index-beacon

Beacon · SEO & discoverability

index-beacon

Check which pages of your built static site search engines are told not to index or follow, via meta robots and X-Robots-Tag, against the rules you actually intend.

npm i -D @mrlouiswright/index-beacon

Published to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).

What it checks

  • Intentdeclare which pages should be noindex (noindex globs; sensible defaults such as /search, /admin/, /drafts/, /thank-you*, /cart*), which must stay indexable (index globs win), and where nofollow is intended…
  • Leakssite-wide noindex, from a /* header rule or because every page is noindex (critical).
  • Per pageunexpected noindex/none, unexpected nofollow, indexable pages that should be noindex, passed unavailable_after dates.
  • Correctnessrobots meta outside <head>, contradictory directives (index + noindex, meta vs header), bot-specific rules (googlebot, bingbot, ...) that disagree with the generic one, unknown or misspelt directives (no-index).
  • Visibilitynosnippet / max-snippet:0 on indexable pages (hides them from rich results and AI answers) and noimageindex.

Quick usage

CLI

npx index-beacon dist
npx index-beacon dist --noindex "/internal/**,/landing/test-*" --fail-on medium
npx index-beacon public --index "/search" --nofollow "/user/**"
npx index-beacon out --no-defaults --report-intended --format markdown

API

import { check, DEFAULT_NOINDEX } from "index-beacon";
const report = check("dist", { noindex: ["/internal/**"], index: ["/search"] });
console.log(report.info.noindex, report.findings);

Every option is documented in the index-beacon docs.

CI / GitHub Action

permissions:
  contents: read
  security-events: write   # only needed for the SARIF upload
jobs:
  index-beacon:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with: { persist-credentials: false }
      - run: npm ci && npm run build   # produce the static site first
      - uses: MrLouisWright/index-beacon@v1
        with:
          path: dist
          fail-on: high
          sarif: index-beacon.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with: { sarif_file: index-beacon.sarif }