I have a Shopify store and I want to block search engines to index some products pages, I found this solution https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines?utm_source=gurucopy&utm_medium=link&utm_campaign=Gurus#undefined
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% endif %}
but I don’t how I should make changes to block my pages
below my page link
mysite.com/products/product-26
mysite.com/products/kalita
Thank You
2
Answers
There is very handy way for doing it.. It works like a charm.. You can make use of metafields property for products provided by Shopify (look for tool called ShopifyFD for Google Chrome)
Create a metafield for the product(s) you want to hide from Google. Have a metafield with namespace as “seo” and key as “robots” and give value as “noindex” or “noindex, nofollow” based on what you need and “Save”
Now in your theme.liquid in head section, add the following
Shopify have an API guide for doing this: Hide a resource from search engines and sitemaps:
You might also want to check out their Developer Tools app, if you are using macOS — that will allow you to perform the post request, after you have authenticated using private app creds.