Robots Meta Tag and X-Robots-Tag: Every Rule a Trades Site Might Use

Robots Meta Tag and X-Robots-Tag: Every Rule a Trades Site Might Use

If robots.txt controls whether Google may crawl a URL, the robots meta tag controls what Google does with a page once it has crawled it. Most trades sites need just one of these rules, noindex, and misuse it more often than they use it correctly. Google’s documentation lists every rule and how they combine. This guide explains them for a WordPress site owner.

I am Robiul Alom Ronju, Founder of Nexranking. The rules below are from Google Search Central’s documentation. The advice on where a trade should use each rule is mine.

Robots meta tag: where it goes, what each rule does, what combines
The rules. Built from Google Search Central.

Where the rules go

A meta tag sits in the head of the page, written as a meta element with the name robots. Google also reads robots meta tags in the body. For files where a meta tag is not possible, such as PDFs and images, you use an HTTP response header called X-Robots-Tag. Names and values are not case sensitive.

Google recognises two user agent tokens in the meta tag: googlebot for web results, and googlebot-news for News. Other tokens are ignored.

The rules, one by one

  • all: no restrictions. This is the default.
  • noindex: keeps the page, media or resource out of search results.
  • nofollow: Google does not follow the page’s links.
  • none: the same as noindex and nofollow together.
  • nosnippet: no text snippet or video preview. A static image thumbnail may still appear. Google adds that this also blocks use of the content as direct input for AI Overviews and AI Mode.
  • max-snippet:number: caps the snippet at that many characters. Zero is the same as nosnippet. Minus one lets Google choose.
  • max-image-preview:setting: none, standard or large.
  • max-video-preview:number: caps video preview length in seconds.
  • noimageindex: images on the page are not indexed.
  • notranslate: no translation offered in results.
  • unavailable_after:date: stops showing the page after that date and time.
  • indexifembedded: allows indexing of content embedded in iframes despite noindex, and only has an effect alongside noindex.

Google also lists rules it ignores: noarchive, nocache and nositelinkssearchbox. If a plugin or an agency has added these, they do nothing for Google.

Combining rules

You can put several rules in one tag, separated by commas, or use several tags. When several crawler specific tags apply, Google takes the sum of the restrictive rules. Google’s example is a general nofollow tag plus a googlebot noindex tag, which means Googlebot reads noindex and nofollow. When rules conflict, the more restrictive wins. For instance, max-snippet of 50 with nosnippet results in nosnippet.

The crawlability trap

This is the point that causes the most damage. Google can only see a meta tag or a header when it crawls the URL. If robots.txt disallows the URL, the rules are never read. Google says that if a page’s indexing or serving rules must be followed, you should not block its URL in robots.txt.

The practical result: if you want a page out of Google, do not block it in robots.txt and add noindex. Block it and Google cannot see the noindex, so the page can stay in results. See robots.txt against noindex. You can confirm what Google sees with the URL inspection tool, where the Indexing allowed field reports a noindex, unless robots.txt hides it.

Controlling text with data-nosnippet

You can keep part of a page out of snippets by adding the data-nosnippet attribute to a span, div or section. Any value is ignored. Google warns against adding or removing it with JavaScript, because it may extract before or after rendering. Structured data inside a data-nosnippet element remains usable.

X-Robots-Tag examples

Google shows server configuration examples. For all PDFs on Apache you would set the header inside a Files block that matches PDF files. For images on NGINX you would add the header inside a location block that matches image extensions. If you do not manage your own server, ask your host, or use a plugin that supports it.

Where a trade should use each rule

This is my own advice.

  • noindex: thank you pages, internal search results, staging copies, thin tag archives and duplicate landing pages.
  • nosnippet or max-snippet: rarely. Most trades want their text in snippets, so do not add these without a reason.
  • nofollow on the whole page: almost never. It stops Google following your own links to your service pages.
  • max-image-preview large: reasonable if you want large previews of your job photos.
  • unavailable_after: useful for a time limited offer page.

What to check on your site today

  1. Open your home page and your top service pages. View the source and look for a robots meta tag. Make sure none says noindex by mistake.
  2. If you use WordPress, check Settings, Reading, and the option that discourages search engines. A site left in that mode is one of the commonest causes of a page not being indexed.
  3. Check Rank Math or Yoast settings for page level noindex.
  4. Check that no noindexed URL is also blocked in robots.txt.

If you want me to review your tags, ask for an audit.

Where does the robots meta tag go?

In the head of the page. Google also reads it in the body. For PDFs and images use the X-Robots-Tag header.

What does nosnippet do?

It prevents a text snippet or video preview. Google says it also blocks use of the content as direct input for AI Overviews and AI Mode.

Does Google use noarchive?

No. Google lists noarchive, nocache and nositelinkssearchbox as ignored rules.

What if rules conflict?

The more restrictive one applies.

Why is my noindex not working?

If robots.txt blocks the URL, Google never sees the noindex tag.

Can I stop one paragraph appearing in snippets?

Yes, with the data-nosnippet attribute on a span, div or section.

Sources