How to hide a product on Shopify but keep it buyable

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 are added at checkout - 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 that are added to the checkout when a 'Free Gift; Limit is reached. These products are $0 and we don't want to sell them to customers without being included in the free product configuration.

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.

  1. Open your Shopify Admin Settings page and go to "Custom Data" then click "Products".
  2. Click "add definition"
  3. Then copy the following settings into the form. (Make sure to update the default "custom.seo_hidden" to be "seo.hidden" instead.)
    1. Name: SEO Hidden
    2. Namespace and key: seo.hidden
    3. Description: 1 = true (hidden), 0 = false (not hidden)
    4. Type: Integer
    5. One Value
  4. 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

  1. Navigate to a product you’d like hidden from on-site search, search engines, and sitemaps.
  2. Scroll down the page to product metafields. You should now see a field for SEO Hidden.
  3. Update this field to equal 1 (true) meaning we would like this product to be hidden from our sites search and search engines.
  4. 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.
  5. You should see no results for the product you have just 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.

  1. Navigate to Online Store > Themes and then open your theme editor by clicking "customise" on the live theme.
  2. Inside the theme editor, open the dropdown in the middle of the header and select products, then click "Create template"
  3. Name the new template to "not-purchasable" so it is clear when we assign it to hidden products and click create.
  4. For ‘Based on’ choose your default product template, or the template you want to copy for this process.
  5. 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.
    1. Some themes may also have this inside a block called “form”.
    2. All themes are different so it may take some investigation to see where your theme has this setting.
  6. For extra measure we can add a text block to mention "This product is not for individual sale".
  7. Save your new "not-purchasable" template.





    Step 3B - Assign the hidden product to the new product template.

    1. Navigate to the product you want to hide inside Shopify Admin area under Products.
    2. Scroll down to the "Theme template" setting in the sidebar of the edit product page.
    3. Change ‘Default product’ to ‘not-purchasable’ and click save.
      1. Note - only templates in your live theme appear on this list. Templates in unpublished themes will not appear.
    4. Confirm it worked by opening your stores theme, and navigating to the product.
      1. 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.



    And thats it! Once you have done this, you products will be available to be purchased but not manually added to the cart.

    Try Checkout Plus For Free Here

    Thank you for reading!




Back to blog

Leave a comment

Please note, comments need to be approved before they are published.