How to Easily Hide a Product or Page from Search Engines in Shopify

How to Easily Hide a Product or Page from Search Engines in Shopify

Did you know that you can very easily hide a product, collection, or page so that it won't be indexed — meaning it won't appear in search engines? This comes in handy when you have a link that customers shouldn't be able to find on their own — for example, if you use helper product collections, or if a product should only be accessible via a direct link. In the past, this required editing your theme code, but now you can handle it entirely with metafields. Just follow the steps below carefully.

1. Open Settings and click on the Metafields and metaobjects tab. Then, depending on which type of link you want to hide from search engines, open the corresponding section.

If you want to prevent a product from being indexed, you need to add a new product metafield. For a page, add a page metafield — and so on for other resource types. Metafields can be created for all types; there's no limit to a single use.

2. For this example, we'll choose Pages and create a new metafield by clicking Add definition.

3. You can name it whatever makes sense to you — for example, Hide from search engines. But now it's really important to set everything up IDENTICALLY, otherwise it won't work! After you enter the name, a namespace will appear in the format custom.your_name_without_diacritics — you need to overwrite this part by clicking on it.

4. The field becomes editable and you can rewrite the entire Namespace and key. Delete everything and type exactly: seo.hidden — including the dot.

5. All that's left is to set the Type, which must be set to Integer. Save it and your metafield is created.

6. Next, navigate to the product / page / collection where you created the metafield. In our example, we go to Pages and open the page we want to hide from search engines. Below the content area, you'll find the Metafields section, where you should now see your newly defined metafield with the name you chose. For any link you want to hide, simply enter the value 1 in the metafield. 1 is treated as true. You don't need to enter 0 in other links — an empty field is simply ignored.

7. If you want to verify that everything worked correctly, open the page in question, view the page source (press Ctrl + U on Windows), and search (press Ctrl + F) for noindex. You should find the HTML line <meta name="robots" content="noindex,nofollow"> — which confirms that the link is hidden from search engines and will not be indexed.

That's it — well done for setting this up yourself! 🎉