What the X-Robots-Tag header is
X-Robots-Tag is an HTTP response header that tells search engines whether to index a URL and how to show it in results. It takes the same values as the robots meta tag, but the server sends it, so it works on any file type. A response that keeps a URL out of Google looks like this:
The values Google supports, from its robots meta tag and X-Robots-Tag documentation:
| Value | What it does |
|---|---|
noindex | Keep the URL out of search results. |
nofollow | Don't follow the links on the page. |
none | Same as noindex, nofollow. |
all | No restrictions. This is the default, so sending it changes nothing. |
nosnippet | No text snippet or video preview in results. |
max-snippet: [n], max-image-preview: [setting], max-video-preview: [n] | Limit the length of the snippet, the size of the image preview, or the seconds of video preview. |
noimageindex | Don't index the images on the page. |
indexifembedded | Allow indexing when the content is embedded in another page through an iframe, despite a noindex. Only works together with noindex. |
notranslate | No translated version of the result. |
unavailable_after: [date] | Drop the URL from results after the date. |
Several values go in one header separated by commas (X-Robots-Tag: noindex, nofollow), or in several headers. Values are not case sensitive.
noindex, nofollow, noarchive: common X-Robots-Tag values
The same few combinations show up in most server configs and audit reports. What each one does in Google, per its robots meta tag docs (updated 2026-03-24):
| Header | In Google | Worth knowing |
|---|---|---|
X-Robots-Tag: noindex | URL is kept out of results | Links on the page can still be followed. Enough for most cases |
X-Robots-Tag: noindex, nofollow | Out of results, links not followed | Same as none. The usual staging value |
X-Robots-Tag: noindex, follow | Same as plain noindex | follow is the default and adds nothing (more on this) |
X-Robots-Tag: noindex, nofollow, noarchive | Same as noindex, nofollow | Google no longer shows cached pages, so noarchive does nothing there. Bing still reads it |
X-Robots-Tag: noindex, nofollow, nosnippet, noarchive | Same as noindex, nofollow | A page that isn't shown has no snippet to hide. The extra values do no harm |
X-Robots-Tag: nosnippet (no noindex) | Indexed, but no text snippet | Also keeps the content from being used as direct input for AI Overviews and AI Mode |
If you find one of these on a URL that should rank, it is the noindex or none part that matters. The rest only changes how an indexed page looks.
Where X-Robots-Tag comes from
The header is added outside the HTML: an nginx add_header or Apache Header set line, a CDN transform rule, a hosting platform's preview-domain setting, or an SEO plugin. Staging environments often send X-Robots-Tag: noindex on every response, and the rule can travel to production with the server config.
How to check the X-Robots-Tag header
The header never shows in the page source, so "view source" and most SEO browser extensions that read the HTML miss it. Four ways to see it:
| Where | How | Catch |
|---|---|---|
| Chrome DevTools | Open DevTools, go to the Network panel, reload, click the request, then Headers > Response Headers | Each redirect is its own row in the list. Click the 3xx rows too, or you only see the last response |
curl | curl -s -L -D - -o /dev/null https://example.com/page | Prints the headers of every hop. curl -I sends a HEAD request, and some servers answer HEAD with different headers than the GET a crawler sends |
| Search Console | URL Inspection, then View crawled page (or View tested page in a live test) | Shows the headers Google got. The crawled version is the last indexed one and only exists for URLs that are on Google; run a live test after a fix |
| The checker above | Paste the URL | Sends a GET as our bot and lists the header on the final response and every redirect hop |
Check the exact URL that matters. A rule that sends the header only for PDFs, one path, or the www host won't show up on the home page.
X-Robots-Tag in nginx and Apache
Google's own example keeps PDFs out of the index. In nginx, inside the server block:
- An nginx
add_headerin theserverorhttpblock reaches everylocationthat has noadd_headerof its own. That is how a stagingnoindexends up on a whole site. Search every config file, including included ones, forX-Robots-Tag. - The reverse also happens: one
add_headerin alocationdrops all the ones inherited from above, unless you run nginx 1.29.3 or later and setadd_header_inherit merge. - Without the
alwaysparameter, nginx only sends the header on 200, 201, 204, 206, 301, 302, 303, 304, 307 and 308 responses. To keep a whole staging site out, putadd_header X-Robots-Tag "noindex, nofollow" always;in itsserverblock. The Apache equivalent isHeader always set X-Robots-Tag "noindex, nofollow": plainHeader setis left off error pages and redirects that Apache generates itself. - To remove a
noindex, delete the line, reload the server, and purge the CDN cache if one sits in front. Then run the URL through the checker above.
Noindex PDFs on WordPress
SEO plugins write their robots tag into the HTML that WordPress builds. A PDF in /wp-content/uploads/ is sent by the web server as a plain file, so no plugin setting reaches it. The file needs the header.
| What you see | What it means | What to do |
|---|---|---|
| Yoast's "Enable media pages" is off, or the site was installed on WordPress 6.4 or later | The attachment page WordPress makes for each upload redirects to the file itself. That stops the thin page, not the PDF | Add the header to the PDF |
| Host runs Apache or LiteSpeed | Both read .htaccess | Put the Apache rule above in the .htaccess in your WordPress root, outside the # BEGIN WordPress block |
| Host runs nginx only | nginx ignores .htaccess | The nginx rule above has to go in the server config. On managed hosting, ask support to add it |
| PDF already in Google | Google drops it after it recrawls the file and sees noindex | Don't block /wp-content/uploads/ in robots.txt, or Googlebot never sees the header |
Paste the PDF's own URL into the checker above to confirm the header is there. The 6.4 change only applies to new installs: on older sites, WordPress keeps attachment pages on.
X-Robots-Tag on Vercel and Cloudflare
Hosting platforms add or need this header in ways that don't show in your own server config:
| Where | What happens | What to do |
|---|---|---|
| Vercel preview deployments | Vercel adds X-Robots-Tag: noindex to every preview deployment, and to the old production deployment once a new one is promoted. | Nothing for previews. If your production domain shows noindex, check that it points at the current production deployment. |
Vercel, custom domain on a non-production branch (e.g. staging.example.com) | Vercel leaves the header out, so the staging copy can be indexed. | Add it yourself: a headers() rule in next.config.js when VERCEL_ENV is preview, or a vercel.json header rule with a has host condition. |
Cloudflare Pages, *.pages.dev URLs | The pages.dev copy of the site can be indexed next to your own domain. | Cloudflare's docs suggest a _headers file rule (below). It doesn't reach responses from Pages Functions: set the header in the function code. |
| Cloudflare in front of any site | A Response Header Transform Rule can set, add or remove X-Robots-Tag on every response, even when the origin sends none. | If a noindex appears that no server config contains, look at Rules > Transform Rules. A Remove rule deletes every header with that name. |
Vercel's own check is curl -I on the deployment URL. The checker above does the same and also shows the header on every redirect hop.
X-Robots-Tag vs robots.txt
They answer different questions. robots.txt says whether a crawler may fetch a URL. X-Robots-Tag says whether a fetched URL may be indexed. Google's robots.txt guide puts it plainly: robots.txt "is not a mechanism for keeping a web page out of Google."
robots.txt Disallow | X-Robots-Tag: noindex | |
|---|---|---|
| Controls | Crawling | Indexing |
| URL can still show in Google | Yes, if other pages link to it, without a description | No, once Google has recrawled it |
| Works on PDFs and images | Blocks the fetch, doesn't hide the URL | Yes |
noindex allowed in it | No. Google doesn't support noindex in robots.txt | Yes |
Don't use both on the same URL. If robots.txt blocks it, Googlebot never fetches it, never sees the header, and the URL can stay in results. That combination is what Search Console reports as Indexed, though blocked by robots.txt. To keep a URL out of Google, allow crawling and send noindex, and leave it crawlable for as long as you want it out.
Header or meta tag
Google treats X-Robots-Tag and <meta name="robots"> the same way and applies the most restrictive of the two. For PDFs, images and other non-HTML files the header is the only option. Either way, Googlebot must be allowed to crawl the URL to see it: a robots.txt disallow hides the noindex. Test that with the robots.txt tester.
Crawler-specific values
X-Robots-Tag: googlebot: noindex applies to Google only; a value without a name applies to all crawlers. Send one header per crawler. This checker reads each header separately.
URL Inspection says 'noindex' detected in 'X-Robots-Tag' http header? Read where that header usually comes from.
We fetch the URL once with GET, as NoindexWatchBot. Some servers send different headers to Googlebot. Results are not stored; cookie values are not shown.