How to hide products from Google in your Shopify store

Normally you want to have your products show up in Google. But every now and then you might want one to be hidden.

For example, maybe there’s a special version only for a specific reseller or maybe your supplier doesn’t allow you to advertise a product at all.

That’s the problem Dan had, he wanted to keep a few products out of the search results.

To do that you can use what’s called a robots HTML tag with the noindex content (also called a noindex tag, though that’s not the correct technical term). This tag tells Google to not index the page, where the index is the search results.

You can easily add this HTML tag to your theme’s template but if you do, you might block all pages. Probably not what you want…

Thinking about it, there are three ways to make this work.

  1. Edit your layout/theme.liquid file and add the tag only for a specific product handle:
{% if template contains "product" and product.handle == "THING" %}
 <meta name="robots" content="noindex">
{% endif %}

Replace THING with the handle of the product you want to hide.

  1. Add a metafield for the product and edit your layout/theme.liquid file to look for that metafield:
{% if product and product.metafields.seo and product.metafields.seo.content %}
  <meta name="robots" content="{{ product.metafields.seo.content }}">
{% endif %}

This code is looking for a metafield on the product in the seo namespace and using the content key. In that key you can put whatever you want for the robots tag, in this case putting noindex will create the noindex tag to hide a product.

  1. Use an app, which might be overkill if you only have one or two products to hide.

Of the three options #2 is the most flexible and can work on any number of products, but takes the most work to document and code (and remember).

Option #1 is great if you only have one or two products you want to hide.

Using an app could be the easiest if you can find an app that doesn’t mess with other parts of your store and is priced reasonably.

The end result of all three is the same, Google sees that tag and they remove that product page from their search results.

Another great optimization for your store is to make sure your product’s structured data is setup correctly for Google’s Rich Snippets. With those you’ll get more traffic and better converting traffic.

You can either audit your store’s structured data by hand or install JSON-LD for SEO and have all the structured data you need.

It’s already helping a few thousand Shopify stores with their structured data and it could help you too.

Eric Davis

Get more organic search traffic for your Shopify store

JSON-LD for SEO icon

Increase organic SEO traffic through Google's Rich Results. One click allows search engines and others to understand your store and products.

Install JSON-LD for SEO