---
title: "X-Robots-Tag"
description: "An HTTP header that carries robots rules such as noindex. Unlike a meta tag, it also works on PDFs, images and other files."
url: https://ursy.com/wiki/x-robots-tag/
updated: 2026-11-26T15:41:51+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/x-robots-tag/
---

# X-Robots-Tag

> An HTTP header that carries robots rules such as noindex. Unlike a meta tag, it also works on PDFs, images and other files.

**X-Robots-Tag is an HTTP response header that carries robots rules, such as `X-Robots-Tag: noindex`.** It does the same job as the robots meta tag, but it sits in the server’s reply instead of the page. So it also works on PDFs, images, videos and other files that have no [HTML](https://ursy.com/wiki/html/).

## What is X-Robots-Tag? {#what-is-x-robots-tag}

It is a line the server sends with a file, before the content. [MDN says](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag) it is not part of any formal specification, but it is a de facto standard way to talk to search [bots](https://ursy.com/wiki/bot-web-robot/) and crawlers. It holds the same rules as the robots [meta tag](https://ursy.com/wiki/meta-tag/): [noindex](https://ursy.com/wiki/noindex/), [nofollow](https://ursy.com/wiki/nofollow/), nosnippet and others. Crawlers find it when they fetch the address.

## Header or meta tag? {#header-or-meta-tag}

|  | Robots meta tag | X-Robots-Tag header |
| --- | --- | --- |
| Where it lives | In the page’s [HTML head](https://ursy.com/wiki/html-head/) | In the server’s HTTP reply |
| Works on PDFs, images, video | No | Yes |
| Set by | Page editor or CMS | Server, CDN or plugin settings |
| Can cover many files at once | One page at a time | Yes, by file type or folder |
| Same rules | Yes: [Google says](https://developers.google.com/search/docs/crawling-indexing/block-indexing) both ways of setting noindex have the same effect |  |

## Why does it matter for search? {#why-does-it-matter-for-search}

A price list PDF or a folder of images cannot carry a meta tag. [Google says](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) to use the X-Robots-Tag header to block indexing of non-HTML files. The flip side is risk. A header can be switched on for a whole site in one server or plugin setting. Nobody sees it on the page, so pages can drop out of the [search engine index](https://ursy.com/wiki/search-engine-index/) without anyone noticing.

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

[Google](https://ursy.com/wiki/google/)’s AI features use the same controls. [Google says](https://developers.google.com/search/docs/appearance/ai-features) a page must be indexed and eligible to show with a snippet to appear as a link in an [AI Overview](https://ursy.com/wiki/ai-overview/) or [AI Mode](https://ursy.com/wiki/google-ai-mode/). It names nosnippet, [data-nosnippet](https://ursy.com/wiki/data-nosnippet/), max-snippet and noindex as the ways to limit what is shown. So a header with `noindex` or `nosnippet` also takes that page out of those AI answers. [Bing says](https://blogs.bing.com/webmaster/February-2026/Introducing-AI-Performance-in-Bing-Webmaster-Tools-Public-Preview) it respects robots.txt and other supported control mechanisms in its AI experiences.

## Which rules can it carry? {#which-rules-can-it-carry}

| Rule | What it asks |
| --- | --- |
| `noindex` | Do not show this page, file or media in search results |
| `nofollow` | Do not follow the links on this page |
| `none` | Same as `noindex, nofollow` |
| `nosnippet` | Do not show a text snippet or video preview |
| `max-snippet: 50` | Use at most 50 characters as a text snippet |
| `max-image-preview: large` | Image preview size: none, standard or large |
| `noimageindex` | Do not index images on this page |
| `indexifembedded` | Allow indexing when embedded in another page, despite noindex |
| `notranslate` | Do not offer a translation in results |
| `unavailable_after: date` | Stop showing the page after this date |

From [Google’s](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) and [MDN’s](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag) lists, checked 24 November 2026. Google says the rules are not case sensitive.

## How does it work? {#how-does-it-work}

The crawler requests the file, reads the headers, then applies the rules. You can send several X-Robots-Tag lines, or one line with rules split by commas. A rule can also name one crawler by its [user agent](https://ursy.com/wiki/user-agent/), such as `X-Robots-Tag: googlebot: nofollow`. Rules without a name apply to all crawlers. [Google says](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) that when rules conflict, the more restrictive one applies: `nosnippet` beats `max-snippet:50`.

## What if two crawlers get different rules? {#what-if-two-crawlers-get-different-rules}

[MDN’s example](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag) shows how they add up:

```
X-Robots-Tag: nofollow
X-Robots-Tag: googlebot: noindex
```

MDN says the [search engine](https://ursy.com/wiki/search-engine/) uses the sum of the negative rules. [Googlebot](https://ursy.com/wiki/googlebot/) reads this as `noindex, nofollow`. Other crawlers read only `nofollow`.

## Where does the header come from? {#where-does-the-header-come-from}

Usually from one of three places: the web server’s settings, a rule at the [CDN](https://ursy.com/wiki/cdn/), or a plugin in your CMS. Each can add the line without changing the page itself. When a header appears that nobody expected, check all three, and compare the reply from the CDN with the reply from the [origin server](https://ursy.com/wiki/origin-server/). On WordPress, an [SEO](https://ursy.com/wiki/seo-search-engine-optimisation/) plugin often sets robots rules; see [WordPress SEO](https://ursy.com/wiki/wordpress-seo/).

## How do snippet rules fit in? {#how-do-snippet-rules-fit-in}

Not every rule removes a page. `nosnippet` and `max-snippet` only limit how much text is shown. That affects [featured snippets](https://ursy.com/wiki/featured-snippet/) and the text Google may show in AI features. For one part of a page, [MDN points](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag) to the `data-nosnippet` HTML attribute instead of a header. Use snippet rules with care: limit too much and there is little left to quote.

## How does it work with robots.txt? {#how-does-it-work-with-robots-txt}

This is the catch most people miss. If [robots.txt](https://ursy.com/wiki/robots-txt/) blocks an address, the crawler never fetches it, so it never sees the header. [Google says](https://developers.google.com/search/docs/crawling-indexing/block-indexing) such a page can still appear in results if other pages link to it. To remove a file, let it be crawled and send `noindex`. MDN adds the other side: if you only want to save bandwidth, robots.txt is the better tool, because indexing rules do not stop the fetch. See [noindex, nofollow or robots.txt](https://ursy.com/wiki/noindex-nofollow-or-robots-txt/).

## A worked example: fee sheets as PDFs {#a-worked-example-fee-sheets-as-pdfs}

A law firm keeps its fee sheets as PDFs and wants them out of Google, while the matching web pages stay in. Google’s documentation shows how to add the header to every PDF. On an Apache web server:

```
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>
```

On NGINX:

```
location ~* \.pdf$ {
add_header X-Robots-Tag "noindex, nofollow";
}
```

For images, Google’s example matches `\.(png|jpe?g|gif)$` and sends `noindex`. A PDF’s reply then includes a line like this, in the format Google shows:

```
HTTP/1.1 200 OK
Date: Tue, 25 May 2010 21:42:43 GMT
(...)
X-Robots-Tag: noindex
(...)
```

The PDFs must stay crawlable in robots.txt, or Google never reads the header.

## A second example: an offer that ends {#a-second-example-an-offer-that-ends}

A shop runs a winter sale page. It can ask search engines to stop showing it after a date:

```
X-Robots-Tag: unavailable_after: Wed, 03 Dec 2025 13:09:53 GMT
```

The date is MDN’s example. [Google says](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) the date must use a widely adopted format such as RFC 822, RFC 850 or ISO 8601. MDN says crawlers are expected to visit that address much less after the date. Once the page is gone for good, a [410](https://ursy.com/wiki/404-and-410/) says so plainly.

## How long until it works? {#how-long-until-it-works}

Not until the crawler comes back. [Google says](https://developers.google.com/search/docs/crawling-indexing/block-indexing) it may take months for Googlebot to revisit a page, and you can ask for a recrawl in [URL Inspection](https://ursy.com/wiki/url-inspection/). The same applies when you remove a header by mistake: the page returns only after a recrawl.

## Common mistakes {#common-mistakes}

- **A site-wide noindex left on after launch.**  Staging settings copied to the live site. Check the header, not only the page.
- **Blocking the file in robots.txt as well.**  The header is then never read.
- **Different rules in header and meta tag.**  The stricter one wins.
- **Expecting it to stop scrapers.**  MDN says only cooperative robots follow these rules.
- **Using it instead of a sign-in.**  Anyone with the address can still open the file.
- **Forgetting the edge cache.**  An [edge cache](https://ursy.com/wiki/edge-cache/) may keep serving old headers until you [purge](https://ursy.com/wiki/cache-purge/) it.

## How to check it {#how-to-check-it}

1. Fetch the page or file with the [HTTP Header Checker](https://ursy.com/http-header-checker/). It shows the [status code](https://ursy.com/wiki/http-status-code/) and any `X-Robots-Tag` line. Check a PDF and an image as well as a page.
2. Check the page’s own robots tag with the [Meta Tag Checker](https://ursy.com/meta-tag-checker/), so you can see both signals together.
3. Make sure robots.txt does not block files whose header you want read. Test the address with the [Robots.txt Checker](https://ursy.com/robots-txt-checker/), and check AI bot rules with the [AI Bot Checker](https://ursy.com/ai-bot-checker/).
4. If the address [redirects](https://ursy.com/wiki/redirect/), check the headers on the final hop. The [Redirect Checker](https://ursy.com/redirect-checker/) shows each one.
5. Make sure your [XML sitemap](https://ursy.com/wiki/xml-sitemap/) does not list files you have set to noindex. Use the [XML Sitemap Checker](https://ursy.com/sitemap-checker/).
6. Get one view of noindex, robots, [canonical](https://ursy.com/wiki/canonical-tag/) and status: the [Indexability Checker](https://ursy.com/indexability-checker/) is live. So is the [AI Training Opt-Out Checker](https://ursy.com/ai-training-opt-out-checker/), which reads robots lines, noai tags and headers.
7. For a whole-site view of AI access, run the [AI Readiness Checker](https://ursy.com/ai-readiness-checker/).
8. In [Google Search Console](https://ursy.com/wiki/google-search-console/), use [URL](https://ursy.com/wiki/url/) Inspection to see whether Google may index the page and what blocks it. Then watch the [Page indexing report](https://ursy.com/wiki/page-indexing-report-index-coverage/) for pages that drop out.
9. Over time, the [index coverage monitor](https://ursy.com/pro/index-coverage-monitor/) and [site audit](https://ursy.com/pro/site-audit/) are in URSY Pro, opening in stages.

## What URSY.com counts {#what-ursy-counts}

We count requests and their status codes from the edge log and the website, including pages the cache answers. A header does not stop a crawler fetching a file, so a noindexed PDF still shows in our counts when a bot reads it. That tells you which bots still spend visits on files you have kept out of search. The full rules are on our [methodology](https://ursy.com/methodology/) page.

## Questions {#questions}

### Does X-Robots-Tag stop AI training? {#does-x-robots-tag-stop-ai-training}

Not by itself. Google, OpenAI, Anthropic and Apple document robots.txt names for training. See [training crawler](https://ursy.com/wiki/training-crawler/) and [Google-Extended](https://ursy.com/wiki/google-extended/).

### Can I use it on one bot only? {#can-i-use-it-on-one-bot-only}

Yes. Put the bot’s name before the rule: `X-Robots-Tag: googlebot: noindex`.

### Is it case sensitive? {#is-it-case-sensitive}

No. [Google says](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) the header, the user agent name and the values are not case sensitive.

### Which wins, header or meta tag? {#which-wins-header-or-meta-tag}

Neither by place. When they conflict, the more restrictive rule applies.

## Related words {#related-words}

- [Noindex](https://ursy.com/wiki/noindex/)
- [robots.txt](https://ursy.com/wiki/robots-txt/)
- [Noindex, nofollow or robots.txt: which one to use](https://ursy.com/wiki/noindex-nofollow-or-robots-txt/)
- [Meta tag](https://ursy.com/wiki/meta-tag/)
- [HTTP](https://ursy.com/wiki/http/)
- [HTTP status code](https://ursy.com/wiki/http-status-code/)
- [Indexed, though blocked by robots.txt](https://ursy.com/wiki/indexed-though-blocked-by-robots/)
- [Technical SEO](https://ursy.com/wiki/technical-seo/)

## Sources {#sources}

- [Google Search Central: Robots meta tag, data-nosnippet and X-Robots-Tag specifications](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag), checked 24 November 2026
- [Google Search Central: Block search indexing with noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing), checked 24 November 2026
- [Google Search Central: AI features and your website](https://developers.google.com/search/docs/appearance/ai-features), checked 24 November 2026
- [MDN: X-Robots-Tag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag), checked 24 November 2026
- [Bing Webmaster Blog: Introducing AI Performance in Bing Webmaster Tools (10 February 2026)](https://blogs.bing.com/webmaster/February-2026/Introducing-AI-Performance-in-Bing-Webmaster-Tools-Public-Preview), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
