WebmasterID logoWebmasterID
Robots & crawl control

X-Robots-Tag header examples

X-Robots-Tag carries indexing directives in the HTTP response header instead of the HTML body, which makes it the way to apply noindex or nofollow to PDFs, images, and other non-HTML files. This page gives concrete header examples and notes how server config applies them in bulk.

Verified against primary sources

Common header examples

X-Robots-Tag uses the same directive vocabulary as the meta robots tag, delivered in the response header. Examples:

X-Robots-Tag: noindex X-Robots-Tag: noindex, nofollow X-Robots-Tag: noarchive

You can also scope a directive to a specific crawler by prefixing its product token:

X-Robots-Tag: googlebot: noindex

Google documents this header form and its supported directives.

Applying it to PDFs and in bulk

The header's main advantage is reaching files with no HTML head. To keep PDFs out of search, set the header for that content type in your server config — for example matching .pdf requests and adding X-Robots-Tag: noindex — so every PDF is covered without editing each file.

Because the directive lives in the response, you can apply it server-wide or per-path. The catch is the same as for meta robots: the crawler must fetch the resource to read the header, so do not also Disallow the URL in robots.txt.

How it appears in analytics and logs

An X-Robots-Tag in a response controls indexing of that resource. As with meta robots, the crawler must be able to fetch the resource to read the header — a disallowed URL's header is never seen.

Diagnostic use case

Apply noindex, nofollow, or noarchive to non-HTML resources and to many URLs at once through server or edge configuration.

What WebmasterID can help detect

WebmasterID shows whether crawlers still fetch a resource, helping you confirm the crawler can reach it to read the X-Robots-Tag you set.

Common mistakes

Privacy and accuracy notes

X-Robots-Tag is an indexing signal, not access control. The resource still needs authentication to be truly private.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.