How to permanently remove duplicate URLs from Google's index?

JuanKarstel
New Member
4 0 0

Hi Guys

 

We recently acquired a new client and after running a crawl of the site we uncovered a number of URLs that are close duplicates of existing Collection Pages and are in Google's Index. See example below.

 

https://www.cherrymelon.co.za/collections/tops

https://www.cherrymelon.co.za/collections/types?q=tops

 

The second URL is the issue and I want to remove them permanently.

Now I have 2 questions:

- How were these pages created as I cannot find them anywhere in the back-end

- Is it possible to remove them completely?

 

Been struggling with this for a while. 

Replies 7 (7)

HerokuLiee
Excursionist
17 1 4

Hello!

 

I guess the easiest way would probably to do something like this in the head of theme.liquid.

 

   {% if handle contains 'types' %}
<meta name="robots" content="noindex">
{% endif %}
JuanKarstel
New Member
4 0 0

@HerokuLiee wrote:

Hello!

 

I guess the easiest way would probably to do something like this in the head of theme.liquid.

 

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

Thanks for your response. Why only quoting 'types' and not the rest of the handle?

Also how did these URLs get created? Basically i have one of these extra for every Collection i have.

HerokuLiee
Excursionist
17 1 4

Probably just the way your theme filters collections. 

 

https://shopify.dev/docs/themes/liquid/reference/objects/handle

 

I think handle will only return the handle part of the URL not the entire URL. If you needed to get the entire URL you'll probably have to do it in JS

JuanKarstel
New Member
4 0 0

Thanks for this advice.
I have added the suggested code, but seems like nothing has changed. 

When i inspect the URL, there is still no tag on META tag on the page.

David_OL
Shopify Partner
58 1 4

Would this app help at all: https://apps.shopify.com/sitemap-noindex-manager

banned
Mircea_Piturca
Shopify Partner
1547 44 346

There is a "native" way of adding no index for a product.

Please see: https://shopify.dev/tutorials/manage-seo-data-with-admin-api

You need to create a Metafield with the following values:

"namespace" : "seo"
"key" : "hidden"
"value" : 1
"value_type" : "integer"

 

Finally—Add variant descriptions to your products
Twinwoods99
Tourist
6 0 1

The other solution - it works as confirmed if you have the filters in the URLs:  

 

{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}

 

 


@Mircea_Piturca wrote:

There is a "native" way of adding no index for a product.

Please see: https://shopify.dev/tutorials/manage-seo-data-with-admin-api

You need to create a Metafield with the following values:

 

"namespace" : "seo"
"key" : "hidden"
"value" : 1
"value_type" : "integer"