Hiding a page from search engines

Search engines such as Google constantly crawl the internet in search of new data. When your site is being crawled, your store's robots.txt file blocks page content that might otherwise reduce the effectiveness of your SEO strategy by stealing PageRank.

By default, your store's robots.txt file tells bots, usually search engine indexing bots or "crawlers", which pages or files they should or shouldn't request to view from a website. For example, your shopping cart page (found at www.example.com/cart) is requested not to be viewed by search engines because it's unique to individual customers and it isn't useful to be indexed by a search engine. All Shopify stores have a preconfigured and optimized robots.txt.liquid template, so you don't need to make any changes to your robots.txt.liquid file unless you have a specific reason to do so. Learn more about editing robots.txt.liquid.

If you want to hide a specific page or product from a search engine but still have it active and published to the online store sales channel, then you can use metatags or a custom metafield to manually hide your content from searches. You can also use unlisted status to hide products.

Learn more about managing searchability in your online store.

Hide a page or product using metatags

You can hide pages that aren't included in your robots.txt.liquid file by customizing the <head> section of your store's theme.liquid layout file. You need to include some metatag code to stop the indexing of particular pages.

Using metatags means that your product or page is hidden from search engines, but is still visible to your storefront search.

Steps:

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, click the Horizontal menu button to open the actions menu, and then click Edit code.

  3. In the layout folder, click the theme.liquid file.

  4. To exclude the search template, paste the following code on a blank line in the <head> section:

{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}
  1. To exclude a specific page or product, paste the following code on a blank line in the <head> section:
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% endif %}

Be sure to replace the page-handle-you-want-to-exclude value with the correct page handle. For example, if you wanted to hide a product called "Exclusive Secret Product" with a handle of exclusive-secret-product, then the if-statement would read: if handle contains 'exclusive-secret-product'.

6. Click Save.

Hiding a product using unlisted product status

If you want to have a product discoverable only by direct URL, then you can unlist your product.

When you set a product as Unlisted, the product is hidden from internet search, Shopify Catalog, and your store's sitemap. Unlisted products also don't display in Shopify-powered collection pages, search results including predictive search, or product recommendations in your storefront.

Learn more about unlisted product status.

Hiding a page or product using a custom metafield

You can add a custom metafield of seo.hidden to a page, blog post, or product in your Shopify admin, and then set the metafield value to 1 to hide the page, blog post, or product from sitemaps, search engines, and your online store search.

seo.hidden is a system metafield that can be used by third-party apps for data storage when they're hiding a resource from search engines and sitemaps. If you receive a message that says Namespace and key. seo.hidden. Namespace and key are already taken. View metafields without a definition, then seo.hidden is being used by third-party apps and isn't available to modify in the Shopify admin. If you want to add definitions to each content type that's already using seo.hidden, then you can create a definition for existing metafields.

Considerations for using a custom metafield with products

If you want a product to be accessible only by using a direct URL, then consider setting the product status as Unlisted instead of using the seo.hidden metafield. An unlisted product is hidden from sitemaps and search engines, and it also doesn't display in your store's Shopify-powered collection pages, search results, or product recommendations, or in Shopify Catalog.

If a product has Unlisted status and the seo.hidden metafield is set to 1, then Unlisted status is prioritized for how the product is displayed and discovered.

Compare product visibility

Review the following table for a comparison of product visibility when using unlisted product status or the seo.hidden metafield. You can't publish unlisted products to Shop.

Descriptions of the impacts of Unlisted product status and the seo.hidden metafield
Feature/functionalityProduct visibility with Unlisted statusProduct visibility with seo.hidden metafield
Internet search
Shopify Catalog
Sitemap
Storefront search
Product page (Online Store and custom storefronts)
Product page (Shop)
Storefront collections
Product recommendations
Shop (home feed/store pages/category pages/search results)
Third-party sales channels

Create a custom metafield

  1. From your Shopify admin, go to Settings > Metafields and metaobjects.

  2. Under Metafield definitions, select the eligible resource type (Products, Pages, or Blog posts) that you want to hide.

  3. Click or tap Add definition.

  4. Set the following fields:

    • Give the metafield a Name such as SEO Hidden, and then select the name from the list.
    • Set Namespace and key to seo.hidden.
    • Optional: Give a brief description, such as "Hides the resource from search engines when value is 1".
  5. Configure the custom field values by doing the following actions:

    1. Click or tap ⊕ Select type and then select Integer.
    2. Select One value.
    3. In the Validations section, set the Maximum value to be 1.
  6. Click Save.

  7. In your Shopify admin, navigate to the page, blog post, or product that you want to hide from search engines.

  8. In the Metafields section, set the value of the SEO Hidden metafield to 1.

  9. Click Save.

To make the page, blog post, or product visible to search engines again, delete the SEO Hidden metafield value, leaving it blank, and then save your changes.

Having Google recrawl your URLs after making a change

If you made changes or added a page to your site, and you want Google to recrawl your URLs, then you have two options:

For more information, refer to Ask Google to recrawl your URLs.