fbpx

Noindexing Auto-Generated Default Pages

Auto-generated default pages, such as cart, checkout, and account pages, can dilute your SEO efforts.

Also, in the case of Shopify, these auto-generated collections don’t allow you to add custom headers and content to improve their SEO.

It’s always better to create your own manual collections to replace them and optimize them for better rankings.

To prevent search engines from indexing these pages, you can use the noindex meta tag.

Shopify

In Shopify, you can add the noindex tag by editing the theme’s theme.liquid file. Follow these steps:

  1. Go to Online Store > Themes > Actions > Edit Code.
  2. Open the theme.liquid file.
  3. To noindex cart, checkout and account pages add the following code:

  {% if template contains 'cart' or template contains 'checkout' or template contains 'account' %}
  <meta name="robots" content="noindex, follow">
  {% endif %}

To noindex vendors and types collections add the following code:

{% if template contains "collection" and collection.handle == "vendors" %}
<meta name="robots" content="noindex, follow">
{% endif %}
{% if template contains "collection" and collection.handle == "types" %}
<meta name="robots" content="noindex, follow">
{% endif %}

To noindex specific Shopify pages such as /collections (all collections), /collections/all (all products), and /collections/new (new products), you will need to add the following code:

{% if (template contains "collection" and collection.handle == "all") or 
(template contains "collection" and collection.handle == "new") or 
(canonical_url == "https://YOURWEBSITE.com/collections") %} 
<meta name="robots" content="noindex, follow"> 
{% endif %}

Save and Publish

  • After adding the noindex tags to the relevant template files, save your changes.
  • Publish the updated theme if necessary.

Verify the Changes

  • Visit the pages you have noindexed and check the page source to ensure the meta tag is correctly included in the <head> section.
  • Use tools like Google Search Console to confirm that these pages are not being indexed by search engines.

WooCommerce (WordPress)

In WooCommerce, you can use a plugin like Yoast SEO to add the noindex tag. Follow these steps:

  1. Install and activate the Yoast SEO plugin.
  2. Go to SEO > Search Appearance > Content Types.
  3. Find the sections for Products, Product Categories, and Product Tags.
  4. Set the Show Products in search results? option to No for each section you want to noindex.

Alternatively, you can add custom code to your theme’s functions.php file:

function noindex_woocommerce_pages() {
  if (is_cart() || is_checkout() || is_account_page()) {
    echo '';
  }
}
add_action('wp_head', 'noindex_woocommerce_pages');