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!