Noindex specific URLs

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. 

0 Likes
HerokuLiee
Excursionist
17 1 3

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.

0 Likes
HerokuLiee
Excursionist
17 1 3

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

0 Likes
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.

0 Likes
David_OL
Shopify Partner
57 1 4
0 Likes
Mircea_Piturca
Shopify Partner
1462 39 285

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
0 Likes