How to use a product tag for adding Meta noindex?

Topic summary

Goal: Add a robots meta tag (noindex,follow) to product pages via a product tag, avoiding per-URL theme edits.

Key fix: Use the Liquid variable for tags on a product object. Condition should check whether product.tags contains “noindex” and, if true, output the meta robots tag in the page head. This leverages Shopify’s product tags rather than hardcoding handles.

Alternatives/resources: Official Shopify guidance was linked for hiding pages from search engines, plus developer docs on using SEO-related metafields (including bulk editing) to hide resources from search engines and sitemaps. These offer a more scalable, admin-driven approach.

Status: A clear solution was provided (use product.tags). No explicit confirmation from the asker, but the answer directly addresses the variable reference needed. Explanation: “noindex,follow” prevents indexing of the page while allowing crawlers to follow its links.

Summarized with AI on February 6. AI used: gpt-5.

Hi all,

I’d like to be able to have the tag appear in a product page’s section by adding a product tag to products we’d like to keep off search (ie: free gifts, samples, etc)

searching, I found this solution to add to theme file:

{% if handle contains 'example-page-url-goes-here' %}
<meta name="robots" content="noindex,follow">
{% endif %}

but this means we’d have to keep editing our theme file and adding URLs.

Instead, I’d like something like:

{% if product_tag contains 'noindex' %}
<meta name="robots" content="noindex,follow">
{% endif %}

so any product tagged with ‘noindex’ will have this meta added. but I cant seem to get this to work. Does anyone know the correct way to cite the variable for a product tag in the snippet above? thank you!

Your close:

{% if product.tags contains 'noindex' %}

{% endif %}

The merchant doc to hide shopify pages from crawlers:

https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines

And using a metafield such as through bulk editing

https://shopify.dev/apps/marketing/seo#step-2-hide-a-resource-from-search-engines-and-sitemaps

2 Likes