Hide a product from search with seo.hidden

Hide a Shopify product, page or blog post from Google, the sitemap and storefront search with the seo.hidden metafield, and when Unlisted status fits better.

Metafield
seo.hidden = 1 (integer)
Works on
Products, pages, blog posts
Hides from
Search engines, sitemap, storefront search
Alternative
Unlisted product status
Last checked

In short

Set the seo.hidden metafield (namespace seo, key hidden, integer) to 1 on a product, page or blog post and Shopify adds noindex and nofollow, removes it from the sitemap and hides it from storefront and predictive search. The product stays in collections and recommendations. If it should only be reachable by its direct link, set the product status to Unlisted instead. Clear the value to make it visible again.

How to use it

  1. Settings > Metafields and metaobjects > Products > Add definition: name SEO Hidden, namespace and key seo.hidden, type Integer, maximum value 1.
  2. Open the product, set SEO Hidden to 1 in the Metafields section and save.
  3. For many products, open the bulk editor on that column with the /bulk?edit=metafields.seo.hidden%3Anumber URL.
  4. For apps and scripts, write the same metafield with metafieldsSet (type number_integer, value "1").

Code

metafields-set.graphql
# Admin API: hide one product from search engines, sitemaps and storefront search.
mutation HideFromSearch($metafields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $metafields) {
    metafields {
      id
      namespace
      key
      value
    }
    userErrors {
      field
      message
    }
  }
}
steps.txt
# 1. Create the definition once
Settings > Metafields and metaobjects > Products > Add definition
Name: SEO Hidden   Namespace and key: seo.hidden
Type: Integer, one value, Validations: maximum value 1 > Save
(Same for Pages or Blog posts if you need it there.)

# 2. Hide a product
Products > (product) > Metafields > SEO Hidden = 1 > Save
To show it again: clear the value and save.

# 3. Many products at once: open the bulk editor on that column
https://admin.shopify.com/store/your-store/bulk?edit=metafields.seo.hidden%3Anumber&resource_name=Product

# Result with seo.hidden = 1
noindex, nofollow on the product page; removed from sitemap.xml;
removed from storefront and predictive search;
still in collections, recommendations and third-party channels.

# Want it reachable only by direct URL? Use product status Unlisted instead.
metafields-set.variables.json
{
  "metafields": [
    {
      "ownerId": "gid://shopify/Product/1234567890",
      "namespace": "seo",
      "key": "hidden",
      "type": "number_integer",
      "value": "1"
    }
  ]
}

Written by Lintel. MIT license: free to use in your own store and in client work.

Limits and edge cases

  • If Shopify says the namespace and key seo.hidden are already taken, an app is already using the metafield without a definition; check Metafields without a definition.
  • With seo.hidden the product still shows in collections, recommendations and third-party channels; Unlisted hides it from those too.
  • If a product is Unlisted and has seo.hidden = 1, Unlisted wins.
  • Already indexed pages drop out after Google recrawls them; use Search Console’s URL Inspection to speed it up.

Questions

How do I hide a product from Google on Shopify?
Set the seo.hidden metafield to 1 on the product. Shopify adds noindex and removes it from the sitemap.
How do I hide a product from Shopify search but keep it in a collection?
Use seo.hidden = 1. It hides the product from storefront search and search engines but keeps it in collections.
What is the difference between Unlisted and seo.hidden?
Both hide from search engines, the sitemap and storefront search. Unlisted also hides the product from collections, recommendations and other channels.
How do I make a hidden product visible again?
Clear the SEO Hidden value on the product and save.
  • Checked on a Shopify store on the date shown. Shopify changes its admin often; if a step looks different, the idea usually still works.
  • Examples use placeholder IDs and your-store.myshopify.com. Replace them with your own.
  • MIT license for the code snippets.

Need this built, tested and maintained for your store? See Shopify development.

Have something to build? Let’s talk it through.

Taking a limited number of projects at a time. Every brief is read by an engineer, not a salesperson.

Gencer KarakayaShopify Engineer

An engineer reads your brief, and we reply by email.