Noindexing parameter/variant pages

siegfredalcover
Visitor
2 0 1

Hello.

 

I am new to shopify. I need to noindex variant pages of products, but I can't find anything after looking it up. I have products that have no variants but still have variant URLs which I need to somehow noindex and remove canonical tags from

An example page is this
Original Page - https://www.bareoutdoors.com.au/products/sorrento-6-seat-round-dining-setting

Variant Page - https://www.bareoutdoors.com.au/products/sorrento-6-seat-round-dining-setting?variant=40141629325365

It's literally the same product but it's both showing up in google causing duplicate content.

Replies 6 (6)
7tea_de
Tourist
3 0 1

Dear Support.

 

We have the same issue. Not only with variants.

The Googlebot and other bots crawls and index ugly pages (yes, we have canonical). But it should noindex.

https://7tea.de/products/bio-zitrone-brennnessel-minze-tee?pr_prod_strat=copurchase&pr_rec_id=c11e3b...

 

It's a waste of crawl budget, ugly URLs and duplicate content.

 

Normally, I would stop crawling with robots.txt for parameters.

Disallow: *?

 

But if indexed and crawled, it's only for the future. We can't remove it: It's blocked now (to prevent further requests).

I have seen here some hints, which I have tried with the theme.liquid.

Like:

 

{% if handle contains 'seq=uniform' %}
<meta name="robots" content="noindex">
{% endif %}

 

from here:

https://community.shopify.com/c/shopify-discussions/why-recommended-products-have-extra-params-in-ur...

 

But it seems, is has no influence inside the source code. It's index, follow furthermore.

Any idea? Many other people have the same issue.

 

@siegfredalcover 

I would add not nofollow. The crawler will break the crawling of other pages from here, and you have a lesser chance to remove the other bad URLs. Nofollow stop further crawling at this point. 

 

Noindex is fine.

Due noindex, it’s also a crawling budget invest for the future. It's reduced the attempts in the future
https://www.seroundtable.com/google-noindex-404-codes-crawl-budget-34510.html

 

Best

 

7

DestMan
Tourist
3 0 1

Hello,

I've fixed the issue above for my website using JavaScript

Use this code below:

<script>
document.addEventListener('DOMContentLoaded', function() {
if (window.location.href.indexOf('?') > -1) {
var metaNoIndex = document.createElement('meta');
metaNoIndex.name = 'robots';
metaNoIndex.content = 'noindex';
document.getElementsByTagName('head')[0].appendChild(metaNoIndex);
}
});
</script>

hope this helps!

Xavi8
Visitor
1 0 0

Hi Destman,

 

Where did you place this script? I've got the same issue, thousands of urls creatred from /search parameter, index, follow, so blocking is not an option until they are no index. Do you think it will work for me?

frankymartin
Shopify Partner
22 0 11

You must add the code in theme.liquid inside head tag.

frankymartin
Shopify Partner
22 0 11

Hi @DestMan and thanks!!

It works for me!!

gardentoolsbox
Visitor
1 0 1

Add the following codes at the end of your theme.liquid file. And then monitor your search console indexing results.

 

{%- if canonical_url="*?variant=*" -%}
<meta name="robots" content="noindex, nofollow">
{%- endif -%}

 

What's more, you can add Disallow: /*?variant=* on Robots testing tool, and test whether it can be indexed or not. Being blocked is the result you want. 

Willy