Technical SEO

X-Robots-Tag: the noindex you can't see in view-source

5 min read

When a page drops out of Google, the first thing most people do is open the page source and search for noindex. If it isn't there, they move on. But there's a second way to say "don't index this", and it never appears in the HTML at all: the X-Robots-Tag HTTP header.

What it is

X-Robots-Tag is a response header that accepts the same directives as the robots meta tag:

HTTP/2 200
content-type: text/html; charset=utf-8
x-robots-tag: noindex, nofollow

Google treats it exactly like <meta name="robots" content="noindex, nofollow">. It can also target one crawler (X-Robots-Tag: googlebot: noindex) and, unlike a meta tag, it works on files that have no HTML: PDFs, images, feeds.

If the header and the meta tag disagree, the more restrictive directive wins. A page with index, follow in its HTML and noindex in its headers is not indexed.

Where it sneaks in

Why it's dangerous: it's invisible to everyone who looks at pages in a browser, it can apply to every URL on a host at once, and it's often configured by a different team than the one that owns SEO.

How to check for it

From a terminal:

curl -sI https://example.com/pricing | grep -i x-robots-tag

No output means no header. A few things to keep in mind:

Our free SEO config check reads the header alongside the meta robots tag, robots.txt and canonical, and tells you which one is responsible.

Fixing it

  1. Find which layer adds it: origin server, framework, CDN/edge, or plugin. Compare headers from the origin directly (bypassing the CDN) and through the CDN.
  2. Remove it for production hostnames only. Keep it on staging and previews, but make the rule match those hostnames explicitly rather than "everything except production".
  3. Request indexing for key URLs in Search Console once the header is gone.
Header changes are the hardest to notice.
CrawlSentry checks the X-Robots-Tag header, meta robots, robots.txt and canonical on your key pages every hour and emails you the moment one changes. 3 URLs free.
Start free