X-Robots-Tag header: how it deindexes pages you wanted to rank
The X-Robots-Tag HTTP header gives the same instructions as a robots meta tag — and it overrides what the meta tag says. A misconfigured noindex header can silently deindex pages you absolutely want ranking.
The X-Robots-Tag HTTP header gives the same instructions as a robots meta tag — and it overrides what the meta tag says. A misconfigured noindex header can silently deindex pages you absolutely want ranking. X-Robots-Tag is an HTTP response header (X-Robots-Tag: noindex, nofollow) that tells crawlers how to treat a URL. It commonly gets set globally by reverse proxies, CDN rules, or framework defaults — and applies to PDFs, images, and non-HTML responses too.
Last updated·
What it is
X-Robots-Tag is an HTTP response header (X-Robots-Tag: noindex, nofollow) that tells crawlers how to treat a URL. It commonly gets set globally by reverse proxies, CDN rules, or framework defaults — and applies to PDFs, images, and non-HTML responses too.
Why it matters
Unlike the meta tag (visible in HTML), the X-Robots-Tag only shows in the raw HTTP response. A misconfigured staging-to-prod CDN rule or a single line in a server config can deindex an entire site overnight. The damage is often discovered weeks later.
How to fix it
- Inspect the header on every indexable URL. curl -I https://example.com/your-page — look for X-Robots-Tag. Should not contain noindex on pages you want ranking.
- Check CDN/edge rules. Cloudflare, Fastly, CloudFront, and Vercel all let you set this at the edge. A staging rule pushed to prod is a common culprit.
- Remove the header in your server config. Apache: Header unset X-Robots-Tag. nginx: more_clear_headers X-Robots-Tag. Test with curl after deploy.
- Set up an alert. A monitor that scans 50 random URLs daily and alarms when X-Robots-Tag: noindex appears unexpectedly catches regressions before Google does.
Authoritative sources
- Google Search Central documentation — Google
- Schema.org vocabulary — schema.org
- SEO Starter Guide — Google Search Central
- MDN — HTML meta and link elements — Mozilla MDN