In this tutorial we will update our store to hide products from users and search engines, but still keep them purchasable or buyable.
This is useful for hiding products that appear as components inside a bundle - that shouldn’t be purchased separately - or for hidden products that your customer support team will link directly to users (like shipping labels).
Our example for this guide is hiding the component products associated with a Bento Box Bundle Product. These products are $0 and we don't want to sell them to customers without being included in our bento box bundle.
In this guide:
- We will create and set a SEO Hidden metafield on products we want hidden from search engines, and on-site search.
- (Optional) We will create a new template for "not-purchasable" products and hide the add to cart button so users can’t add the product if they do manage to find the product page through a direct link.
- You will also need to ensure the products you want to hide are not in any collections.
Step 1 - Hide the product from search with the SEO Hidden metafield
We’ll create a metafield that Shopify uses to hide products from on-site search, search engines, and sitemaps.
- Open your Shopify Admin Settings page and go to "Custom Data" then click "Products".
- Click "add definition"
- Then copy the following settings into the form. (Make sure to update the default "custom.seo_hidden" to be "seo.hidden" instead.)
- Name: SEO Hidden
- Namespace and key: seo.hidden
- Description: 1 = true (hidden), 0 = false (not hidden)
- Type: Integer
- One Value
- Click save
This will create a metafield with the namespace "seo" and the key "hidden" which is a standard shopify metafield for hiding products from search on your storefront and from google.
We recommend providing yourself with a description explaining the integer field, Shopify treats this metafield as boolean (true/false). With 1 equaling true and 0 equaling false.
You’ll now be able to set this metafield on your products.
Step 2 - Update your new SEO Hidden metafield on your products
- Navigate to a product you’d like hidden from on-site search, search engines, and sitemaps.
- Scroll down the page to product metafields. You should now see a field for SEO Hidden.
- Update this field to equal 1 (true) meaning we would like this product to be hidden from our sites search and search engines.
- Confirm it worked by opening your stores theme. (Wait 3 mins or so for Shopify to update with this change) Then refresh and try to search for your product.
- You should see no results for the product you have just hidden.
You do not need to update all products to have this value. If the field is empty it is considered ‘0’ or ‘false’ and will not be hidden.
Step 3A - Remove the buy buttons from your product template
Now we will create a template with the add to cart button removed and assign this template to our hidden product.
This step is optional, and will prevent users from adding the product to cart if they land on the page directly.
If you just want products hidden from site, but still want users to purchase them individually, you can skip this step and link users directly to the product page.
- Navigate to Online Store > Themes and then open your theme editor by clicking "customise" on the live theme.
- Inside the theme editor, open the dropdown in the middle of the header and select products, then click "Create template"
- Name the new template to "not-purchasable" so it is clear when we assign it to hidden products and click create.
- For ‘Based on’ choose your default product template, or the template you want to copy for this process.
- Now we can remove the block in our theme called "buy buttons". If you can't see one by this name it may be called "add to cart button" or something similar.
- Some themes may also have this inside a block called “form”.
- All themes are different so it may take some investigation to see where your theme has this setting.
- For extra measure we can add a text block to mention "This product is not for individual sale".
- Save your new "not-purchasable" template.
Step 3B - Assign the hidden product to the new product template.
- Navigate to the product you want to hide inside Shopify Admin area under Products.
- Scroll down to the "Theme template" setting in the sidebar of the edit product page.
- Change ‘Default product’ to ‘not-purchasable’ and click save.
- Note - only templates in your live theme appear on this list. Templates in unpublished themes will not appear.
- Confirm it worked by opening your stores theme, and navigating to the product.
- If you just completed the SEO Hidden step then you will need to copy the products url from the ‘Search engine listing’ card as your product is hidden from your themes search now.
Further work - Grid items and Quick Add To Carts
We have just covered 90% of the possible ways for customers to find and add a hidden product to cart.
However there is one more way... product grid items - especially in automatic recommended products that have Quick Add To Cart buttons.
You can turn off the Quick Add To Cart setting in your theme, or follow along in our future guide for hiding quick add to cart buttons for products with a specific tag.