fbpx

How to remove Shopify pages and products from an XML sitemap

Shopify

There is free and easy way to hide and remove Shopify pages and products from your site’s XML sitemap and from Google search results. Simply add a Shopify metafield to your page or product with a specific SEO “hidden” setting. This metafield will remove your page or product from your sitemap.xml file and adds noindex meta data to the HTML that prevents Google from showing it in search results.

Hide pages or products from a Shopify XML sitemap

Add a new Hide from XML Sitemap metafield

Hiding content from a Shopify XML sitemap using a metafield will remove them from the sitemap.xml file and hide them from Google search results.

  1. Log in to your Shopify admin
  2. Go to Settings > Metafields
  3. Click Products
  4. Click Add definition
  5. Enter the following metafield settings:
    1. Name: Hide from XML Sitemap
    2. Namespace and key: seo.hidden
    3. Check the Expose this metafield... checkbox
    4. Select content type: Number
      1. Select Integer if it isn’t already selected
    5. Click the Save button
  6. Click the <- back arrow button to go back to the main Metafields page
  7. Click Pages
  8. Repeat step #5 above for the Pages metafield

Update the Hide from XML Sitemap metafield for each page or product

Now that you’ve completed the steps above to create your Hide from XML Sitemap metafields – you need to update the metafield for each page or product you want to hide.

  1. In your Shopify admin, go to edit the page or product you wish to hide.
  2. Scroll down to the bottom of the editor page and enter the number 1 on the Hide from XML Sitemap metafield
  3. Click the Save button

Repeat these steps for each page or product you want to hide from search engines.

View pages or products in your Shopify XML sitemap

The XML sitemap is located at the root of your site’s primary domain. For example:

yourprimarydomain.com/sitemap.xml

Robert Bentley
A Shopify expert who has helped numerous online businesses achieve top sales performance through expert development and optimization.