What Is X-Robots-Tag? When Should You Use It?

Santaji GadeTechnical SEOSEO2 weeks ago30 Views

X-Robots-Tag

You can't put a meta tag inside a PDF. Here's the HTTP header that reaches every file type your server sends — full syntax, per-crawler targeting, how directives combine, and a decision tool for choosing robots.txt vs. meta tag vs. this header.

Technical SEO X-Robots-Tag HTTP Headers Crawling

You cannot put a meta tag inside a PDF. There is no head section in a JPEG, an MP4, or an Excel file. Yet these files still get indexed by Google every day, sometimes ones you never meant to be searchable at all. X-Robots-Tag is the one control that reaches every file type your server sends out, HTML or not.

X-Robots-Tag is an HTTP response header that delivers the same indexing and serving directives as a meta robots tag, noindex, nofollow, noarchive, and more.

It applies these rules at the server level to any file type, including PDFs, images, and videos that have no HTML head to hold a meta tag at all.

Advertisement
Advertisement

We covered the page-level version of these directives in our meta robots tags guide, and the crawling layer beneath both in our robots.txt guide. X-Robots-Tag is the piece that handles everything those two cannot.

0

meta tags a PDF, image, or video file can technically contain

2

ways to combine rules: multiple header lines, or one comma-separated list

1

rule to remember: robots.txt blocking hides the header from crawlers entirely

A Bouncer vs. a Sign Inside One Room

🚪

X-Robots-Tag (HTTP Header)

A bouncer at the building entrance, deciding what's allowed in before a crawler ever reaches any specific file.

📄

Meta Robots Tag (HTML)

A sign posted inside one room of the building. Useful, but only works where an HTML head actually exists.

Basic X-Robots-Tag Syntax

HTTP/1.1 200 OK
Date: Tue, 25 May 2026 21:42:43 GMT
X-Robots-Tag: noindex

A minimal response telling every crawler not to index this URL

Blocking Non-HTML Files at the Server Level

According to Google Search Central's official robots meta tag documentation, this is the primary reason X-Robots-Tag exists: controlling indexing for file types that simply cannot host an HTML tag.

# Apache: block all PDFs from indexing
<Files ~ ".pdf$">
  Header set X-Robots-Tag "noindex, nofollow"
</Files>

# Apache: block image files specifically
<Files ~ ".(png|jpe?g|gif)$">
  Header set X-Robots-Tag "noindex"
</Files>

According to Search Engine Journal's guide to X-Robots-Tag, these two blocks handle the most common real-world use case

Targeting Specific Crawlers Within the Header

According to MDN's X-Robots-Tag reference, a user agent can be specified directly inside the header value, letting different bots receive different rules from the same response.

X-Robots-Tag: googlebot: nofollow
X-Robots-Tag: BadBot: noindex, nofollow

Googlebot gets only nofollow here; a specified bot named BadBot gets both noindex and nofollow

What Happens When Multiple Rules Combine

According to MDN's reference referenced above, when several crawler-specific rules apply, search engines sum the negative directives rather than picking just one.

A response sending both X-Robots-Tag: nofollow and X-Robots-Tag: googlebot: noindex combines both directives for Googlebot specifically.

Googlebot interprets this exact combination as noindex, nofollow together, even though neither line alone stated both directives explicitly.

The Full Directive Reference

DirectiveWhat It Controls
noindexKeeps the URL out of search results entirely
nofollowTells crawlers not to follow links found in the resource
noarchivePrevents a cached copy from being shown
nosnippetBlocks text snippets and thumbnail previews in results
unavailable_afterAutomatically removes the URL after a specified date
noimageindexPrevents images on the page from being indexed
notranslatePrevents search engines from offering a translation
indexifembeddedAllows indexing when embedded via iframe, even with noindex set
Advertisement
Advertisement

Which Robots Control Should I Use?

Select the resource type to see the right tool for the job.

Which Robots Control Should I Use?

Robots.txt, meta robots tag, or X-Robots-Tag

Use a meta robots tag directly in the page's head section.

Why This Header Matters More at Scale

According to Andres SEO Expert's technical definition guide, implementation at the server level allows high-scale, programmatic control across entire directories, rather than editing individual page templates one at a time.

According to Ferdy's 2026 explanation of this header, for standard HTML pages and posts, a meta robots tag through an SEO plugin remains the simpler default. This header specifically earns its keep for downloads, PDFs, and files an SEO plugin cannot reach.

Real-World Use Cases Worth Knowing

According to Nuwtonic's complete guide to mastering this header, expiring campaign pages, event materials, and licensed documents are common candidates for combining noarchive with unavailable_after, automatically removing outdated resources from results without manual cleanup.

According to Acromatico's AI visibility glossary entry, teams managing large document libraries or media-heavy sites benefit most, since a single server rule can govern thousands of files that would otherwise need individual review.

How to Check for an Existing X-Robots-Tag

According to Rank-O-Saur's guide to the X-Robots-Tag header, the header is invisible on the page itself, so checking requires opening browser DevTools' Network tab, selecting the file, and reading the Response Headers section.

# Or check directly from the command line
curl -I https://example.com/document.pdf

The -I flag returns headers only, showing any X-Robots-Tag present on that response

The One Trap Shared With Meta Robots Tags

According to Search Roost's guide to HTTP-level index controls, blocking a URL in robots.txt prevents the crawler from ever fetching it, which means any X-Robots-Tag on that response is never seen or followed either.

Advertisement
Advertisement

FAQs on X-Robots-Tag

When should I use X-Robots-Tag instead of a meta robots tag?
Use it for non-HTML files like PDFs, images, and videos, which have no HTML head to hold a meta tag, or when you want to apply rules across many files at the server level at once.
Can X-Robots-Tag target a specific crawler?
Yes. A user agent name can be specified directly inside the header value, letting different bots receive different directives from the exact same response.
Does blocking a URL in robots.txt still let the X-Robots-Tag work?
No. If robots.txt blocks crawling, the crawler never fetches the response, so any X-Robots-Tag present is never seen or followed at all.
How do I check if a page or file has an X-Robots-Tag?
Open browser DevTools' Network tab, select the resource, and check Response Headers, or run curl -I against the URL from a command line to see the raw headers.
Can I combine multiple directives in one X-Robots-Tag?
Yes, either as a comma-separated list on one line, or as multiple separate X-Robots-Tag header lines within the same response.
Is X-Robots-Tag part of an official web standard?
No. Unlike robots.txt, which follows RFC 9309, the X-Robots-Tag header is not part of any current official specification, though it is widely documented and supported by major search engines.

> what_we_learn_today.log

[OK]

X-Robots-Tag is the only option for indexing control on non-HTML files

[OK]

It can target specific crawlers directly inside the header value

[OK]

Multiple crawler-specific rules combine as summed negative directives

[OK]

It's invisible on the page; DevTools or curl are needed to check it

[OK]

robots.txt blocking hides it from crawlers just like a meta robots tag

[OK]

It's not part of an official spec, but is widely supported regardless

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Loading Next Post...
Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...