# X-Robots-Tag

> Use X-Robots-Tag when indexing rules belong in an HTTP response. Learn where it fits, how crawler-specific rules work, and how to verify the header.

Canonical: https://scaplet.com/glossary/x-robots-tag

Glossary Glossary · Crawling and indexing

Use X-Robots-Tag when indexing rules belong in an HTTP response. Learn where it fits, how crawler-specific rules work, and how to verify the header.

3 min

read

2

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

`X-Robots-Tag` is an HTTP response header that gives search crawlers indexing or snippet instructions for a URL. It is useful for non-HTML files such as PDFs and images, which cannot carry a robots meta tag. A crawler must be able to fetch the URL to read the header.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fx-robots-tag%20(%22X-Robots-Tag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fx-robots-tag%20(%22X-Robots-Tag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fx-robots-tag%20(%22X-Robots-Tag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fx-robots-tag%20(%22X-Robots-Tag%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [When to use a response header 01](#when-to-use-a-response-header)
2. [Scope rules carefully 02](#scope-rules-carefully)
3. [Verify the response Google can see 03](#verify-the-response-google-can-see)

_01_Check it

## When to use a response header

Use a [robots meta tag](/glossary/robots-meta-tag) when you control an HTML page's `<head>`. Use `X-Robots-Tag` when the rule belongs to the HTTP response, especially for PDFs, images, and other files without HTML. Google supports the same indexing and serving rules in either place.

To send the header for every PDF on a site, Google's documentation says to add a [snippet](/glossary/snippet) to the root `.htaccess` or `httpd.conf` file on Apache, or to the site's `.conf` file on NGINX.

Apache and NGINX, from Google's docs

```
# Apache <Files ~ "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </Files> # NGINX location ~* \.pdf$ { add_header X-Robots-Tag "noindex, nofollow"; }
```

Google's docs show server rules that match a group of URLs, such as every `.pdf`. A broad rule like that applies to every matching response. See [noindex](/glossary/noindex) for the decision between exclusion, crawl blocking, and [canonicalization](/glossary/canonical-url).

Exclude a PDF from Google Search

```
HTTP/1.1 200 OK Content-Type: application/pdf X-Robots-Tag: noindex
```

_02_Checklist

## Scope rules carefully

First_2_
Rules specified without a [user agent](/glossary/user-agent) are valid for all crawlers: `X-Robots-Tag: noindex`.

Prefix a rule with a crawler name when it should apply only to that crawler, such as `X-Robots-Tag: googlebot: noindex`.

Next_1_
You can combine supported rules with commas or send multiple headers. If rules conflict, Google applies the more restrictive instruction.

Then_1_
A header is not access control. Google's noindex guidance says to password-protect a page to keep it out of Google; `noindex` tells search engines not to show a URL, and does not restrict who can open it.

**Do not block the URL before Google reads the rule**If robots.txt disallows crawling, Google cannot fetch the response header. Google says the crawler will never see the `noindex` rule, and the page can still appear in search results, for example if other pages link to it.

_03_How it works

## Verify the response Google can see

For the crawl-control counterpart, see [robots.txt](/glossary/robots-txt). For the page-level version of the same indexing decision, see [noindex](/glossary/noindex).

1. 01

### Request the exact file URL

Run `curl -sIL https://example.com/file.pdf` (`-L` follows redirects) and inspect the final response. Confirm the header is present on the response serving the file.
2. 02

### Check the status and scope

Make sure the URL returns the expected file and status, and that a server or CDN rule has not added a broader directive to neighboring URLs.
3. 03

### Confirm crawl access

Check robots.txt and authentication. Google says the page must not be blocked by robots.txt and has to be otherwise accessible to the crawler.
4. 04

### Recheck after deployment

Test a representative URL for each file type or route pattern. A header added with a pattern rule can affect files that were never part of the intended change.

Questions

## Asked a lot.

3 questions people ask next, answered from the sources on this page.

_01_ Can X-Robots-Tag be used on HTML pages?

Yes. Google says any rule that can be used in a robots meta tag can also be specified as an `X-Robots-Tag`. The header is the option for non-HTML resources, and for HTML you cannot edit.

_02_ Does X-Robots-Tag stop Google from crawling a URL?

No. It is read from the response after Google fetches the URL. Use robots.txt to control crawling; keep the URL crawlable when Google needs to process a `noindex` header.

_03_ Can I use X-Robots-Tag to hide a private file?

No. It is a search instruction, not access control. Google's guidance for keeping a page out of Google is `noindex` or password protection; for confidential files, restrict access.

Sources · 2

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- google.com

1. 01 [Robots meta tag, data-nosnippet, and X-Robots-Tag specifications](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) developers.google.com · checked 2026-10-24
2. 02 [Block Search indexing with noindex](https://developers.google.com/search/docs/crawling-indexing/block-indexing) developers.google.com · checked 2026-10-24

## Keep learning

[All glossary](/glossary)

[Learn Noindex Crawling and indexing](/glossary/noindex) [Related robots.txt Crawling](/glossary/robots-txt) [Read next Robots meta tag Crawling and indexing](/glossary/robots-meta-tag) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[x-default](/glossary/x-default) [YMYL](/glossary/ymyl)

More in Crawling and indexing
[Trailing slash in URLs](/glossary/trailing-slash) [unavailable_after](/glossary/unavailable-after) [URL fragment](/glossary/url-fragment) [URL Inspection tool](/glossary/url-inspection-tool) [URL parameters](/glossary/url-parameters) [URL structure](/glossary/url-structure) [User agent](/glossary/user-agent) [Video sitemap](/glossary/video-sitemap) [Web crawler](/glossary/web-crawler) [Web scraping](/glossary/web-scraping) [www vs non-www](/glossary/www-vs-non-www) [X-Frame-Options](/glossary/x-frame-options) [X-Robots-Tag](/glossary/x-robots-tag) [XML sitemap](/glossary/xml-sitemap) [301 redirect](/glossary/301-redirect) [302 redirect](/glossary/302-redirect) [410 Gone](/glossary/410-gone) [A record (DNS address record)](/glossary/a-record) [Bing Webmaster Tools](/glossary/bing-webmaster-tools) [Bot management](/glossary/bot-management) [Broken links](/glossary/broken-links) [cache: search operator](/glossary/cache-search-operator) [Canonical HTTP header](/glossary/canonical-http-header) [Canonical URL](/glossary/canonical-url)

Terms on this page
[Robots meta tag](/glossary/robots-meta-tag) [Search snippet](/glossary/snippet) [Noindex](/glossary/noindex) [Canonical URL](/glossary/canonical-url) [User agent](/glossary/user-agent) [robots.txt](/glossary/robots-txt)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
