X-Robots-Tag is an HTTP response header that gives search engines the same instructions as a robots meta tag. It is sent before the page content, so you will not find it by viewing the page source. If Search Console says a page is noindexed but there is no tag in the HTML, this header is almost always the reason.
What it looks like
HTTP/2 200
content-type: text/html; charset=utf-8
x-robots-tag: noindexIt can carry the same values as the meta tag, such as noindex, nofollow, none, noarchive and nosnippet. It can also target one crawler, for example X-Robots-Tag: googlebot: noindex.
Why sites use it
- Non-HTML files. PDFs, images and other files have no
<head>, so a header is the only way to noindex them. - Whole environments. One server rule can keep an entire staging or preview site out of Google.
- Hosting defaults. Some platforms add it automatically to preview deployments.
The trouble starts when a staging rule is copied to production, a CDN rule matches too broadly, or a framework decides the live site is “not production”.
How to check for X-Robots-Tag
In the browser
- Open developer tools (
F12) and go to the Network tab. - Reload the page and click the first request, the page itself.
- Under Response Headers, look for
x-robots-tag.
From the command line
curl -sI https://example.com/page | grep -i x-robots-tagNo output means no header. Check the final URL after redirects too: add -L to follow them, since a rule may apply only to the destination.
With Search Console or SEOAlertly
Search Console’s live URL test reports a noindex found in the HTTP header. SEOAlertly’s site check reads the X-Robots-Tag header on every sampled page and shows the exact directive it found.
How to remove it
First find which layer adds the header: your application, the web server, or a CDN or host in front of it. Then remove or narrow the rule.
Apache (.htaccess or server config)
# Look for lines like this and remove them,
# or limit them to the files that need them
Header set X-Robots-Tag "noindex"
# Example: noindex only PDF files
<FilesMatch "\.pdf$">
Header set X-Robots-Tag "noindex"
</FilesMatch>Nginx
# Remove this from the server or location block
add_header X-Robots-Tag "noindex";Reload Nginx after the change, for example with sudo nginx -s reload.
Netlify, Vercel and similar hosts
Look in netlify.toml, _headers or vercel.json for an X-Robots-Tag header rule. Make sure your custom production domain is not being served as a preview. A preview header on a preview URL is normal; on your live domain it is not.
Next.js and other frameworks
Search the project for X-Robots-Tag. In Next.js, check the headers() function in next.config and any middleware that sets response headers.
CDNs such as Cloudflare
Check transform rules, workers and page rules that modify response headers. A rule written for a staging hostname can match more than you expect.
After you remove it
- Purge your CDN cache, then confirm the header has gone with
curl -sI. - Run Test live URL in Search Console and request indexing.
- Check that robots.txt is not blocking the URL. Google needs to crawl the page to notice the change.
For noindex inside the HTML, see how to find and remove a noindex tag.
