How to add nofollow to tags on collection pages?

Highlighted
New Member
2 0 0

Hello!

 

I am trying to make all the links to tags on collection pages nofollow. I do have filters to things like size, color, brand etc. and each of those filters create a new URL such as www.domain.com/collections/category/color.

 

I am looking for a solution to make those links on the sidebar NoFollow.

 

Any thoughts would be highly appreciated!

 

 

0 Likes
Shopify Partner
531 110 150

@Shopster11 

 

Go to the theme.liquid file and add following code befoer the </head> tag:

{% if template contains "collection" and current_tags != blank %}
<meta name="robots" content="noindex, nofollow" />
{% endif %}

Cheers,

Tejas

 

 

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
0 Likes
New Member
2 0 0

Thanks @Tejas_Nadpara ! I tested the code you provided, however it's not exactly what I was looking to achieve. It basically added nofollow, noindex to the tagged pages i.e inside domain.com/collections/category/color. However, what I am trying to achieve is making the tags on the sidebar on page domain.com/collections/category nofollow.

 

In other words, I don't want google to crawl any page with the "color" tag on any of the collection pages. Any thoughts? 

0 Likes
Shopify Partner
531 110 150

@Shopster11 

 

If you are looking to add noindex, nofollow tag for all collections pages then use following code:

{% if template contains "collection" %}
<meta name="robots" content="noindex, nofollow" />
{% endif %}

Let me know still it not working for you.

 

Thank you,

Tejas

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
0 Likes