This guide answers: meta robots and x-robots-tag: noindex, nofollow and the other directives
Meta robots and X-Robots-Tag: noindex, nofollow and the other directives
Learn how meta robots and X-Robots-Tag differ, when to use the tag or the HTTP header, and what noindex, nofollow and the other directives do.
By Hannah Wells, Technical SEO, site performance and online stores
· 6 min read
updated

Short answer
Meta robots and X-Robots-Tag do the same job: they tell Google how to index a page and how to show it in results. The meta tag sits in the HTML of a page. The X-Robots-Tag is an HTTP header sent by the server. Use the tag for pages, and the header for files that have no HTML, such as PDFs, images and videos.
Key points
- The meta robots tag is a line of HTML placed in the <head> of a page.
- Here are the ten directives, what each one does and when to use it.
- The syntax is simple. Put a meta tag in the <head>, set name="robots", and list the directives in content.
- Use the header when the file is not HTML. A PDF has no <head>, so a meta tag is impossible.
Key figures at a glance
- 10directives covered
- 2ways to deliver them: HTML tag or HTTP header
- 0support for noindex inside robots.txt
Meta Robots and X-Robots-Tag: What’s the Difference?
The meta robots tag is a line of HTML placed in the <head> of a page. It controls how Google indexes that page. It can hold several directives, separated by commas, or you can use several tags.
The X-Robots-Tag is the same instruction, but it travels in the HTTP response instead of the HTML. The server sends it before the content itself. That is why it works on files that cannot hold a tag, like PDFs, images and videos.
Every directive available as a meta tag can also be sent as an X-Robots-Tag. The two methods share one vocabulary. Only the delivery changes.
Schema: where each method lives
Lives in the HTML
<head>Best for web pages
Lives in the HTTP header
Best for PDFs, images, videos
Same words, same effect
Only the delivery differs
The 10 Directives Explained
Here are the ten directives, what each one does and when to use it.
noindex
Keeps the page out of Google results. The page must stay crawlable, or Google never sees the instruction. Example: <meta name="robots" content="noindex">
nofollow
Tells Google not to follow the links on the page, so it does not scan the URLs they point to. Example: <meta name="robots" content="nofollow">
none
A shortcut for “noindex, nofollow”. Use it when you want both at once.
nosnippet
Stops Google from showing a text excerpt or a video preview in results. Static thumbnails remain allowed.
notranslate
Stops Google from offering a translation of the page in results.
noimageindex
Stops Google from indexing the images on the page, so they do not appear in Google Images.
max-snippet
Caps the text excerpt at a number of characters. Example: max-snippet:20. A value of 0 equals nosnippet. A value of minus 1 lets Google pick the length it prefers.
max-image-preview
Sets the size of the image preview in results. It accepts “none”, “standard” or “large”.
max-video-preview
Limits the video preview length in seconds. A value of 0 gives a single static frame.
unavailable_after
Removes the page from results after a given date and time. Accepted formats are RFC 822, RFC 850 and ISO 8601. Example: unavailable_after: 2020-09-21
How to Implement Meta Robots in HTML
The syntax is simple. Put a meta tag in the <head>, set name="robots", and list the directives in content.
To block a page from the index and stop link following, write this:
<head>
<meta name="robots" content="noindex, nofollow">
</head>
You can combine directives in one tag with commas. You can also use several tags, one per directive. Both approaches are valid.
The tag must be in the <head>. A tag placed elsewhere is not the documented method, so keep it at the top where it belongs.
How to Implement X-Robots-Tag at the Server Level
Use the header when the file is not HTML. A PDF has no <head>, so a meta tag is impossible. The server has to say it for you.
The syntax is X-Robots-Tag: noindex, nofollow. You can also send several headers, one per directive.
On Apache, to keep PDF files out of the index:
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>
On NGINX, to keep images out of the index:
location ~* \.(png|jpe?g|gif)$ {
add_header X-Robots-Tag "noindex";
}
You can also aim a header at one bot. For example, X-Robots-Tag: googlebot: nofollow applies only to Googlebot. Check your server documentation for the exact syntax before you deploy.
Combining Directives and Conflict Resolution
Sometimes several rules apply to the same page. A tag may say one thing and a header another. Google applies the most restrictive rule.
- The tag says “index” and the header says “noindex”: Google treats the page as noindex.
- One rule allows a long snippet and another says nosnippet: the stricter rule wins.
Schema: the most restrictive rule wins
+
Header: noindex
=
Page treated as noindex
Beyond “the most restrictive rule wins”, the documentation does not spell out how Google ranks priorities among many conflicts. So keep things simple: one clear instruction per page, delivered by one method where you can.
The robots.txt Trap: Why It Breaks Noindex
This is the most common way to defeat your own noindex. Google reads a noindex tag only when it can open the page. If robots.txt blocks the page, Google never gets in, never sees the tag, and cannot act on it.
Think of a locked door with a note on the other side. The note says “do not list this room”. Nobody outside can read it.
Google states plainly that specifying the noindex rule in the robots.txt file is not supported. Robots.txt controls crawling. Noindex controls indexing. They are different tools, and noindex only works on a page that is crawlable.
If you want a page out of results, leave it open to crawling and add noindex, in a meta tag or in an X-Robots-Tag header. Then do not block it in robots.txt.
Mixing up nofollow and noindex
Nofollow is about the links on a page. Noindex is about the page itself. If you want a page out of results, you need noindex.
Writing noindex in robots.txt
Google does not support it there. Move the instruction to a meta tag or an X-Robots-Tag header.
Blocking in robots.txt, then adding noindex
The block stops Google from reading the noindex. Remove the block so the page can be crawled and the instruction seen.
Thinking noindex stops crawling
It does not. Noindex controls what appears in results, and the page has to be crawlable for Google to read it.
Sending conflicting signals
A tag that says “index” and a header that says “noindex” will end as noindex. Check both layers when a page behaves unexpectedly.
Some points remain open in the documentation. It does not say how long Google takes to apply a noindex after it first sees it, and that delay can vary. It does not describe what happens when a PDF carries a noindex header while an indexed page links to it. If those cases matter to you, test them on your own setup rather than assume.
Remember what these directives are for. They control indexing and presentation in results. They are not a ranking lever, so use them to manage what is shown, not to promise a result.
Sources
- Google Search Central: Robots meta tag, data-nosnippet, and X-Robots-Tag specifications, consulted 03/12/2026
- Google Search Central: Block Search indexing with noindex, consulted 03/12/2026


