I want to add a Noindex tag to filtered URLs

I want to add a Noindex tag to filtered URLs

Rene89
New Member
8 0 0

Hello, I want to add a Noindex tag to our URLs that have parameters or a question mark in them but I can't find a solution. I tried the following code but it doesn't work:

 

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

 

Basically what's happening is that Google is indexing thousands of URLs for collections with filters (e.g. https://www.allcam.nl/collections/dashcams?filter.p.m.custom.touchscreen=0&filter.p.m.custom.wifi=0&...). The URLs have correctly pointed canonical URLs but the pages are blocked by Robots.txt which is why Google isn't crawling or loading the pages and therefore not seeing the canonical URL (I think?). I surely can't be the only one with this problem?

 

Thanks for any help.

Replies 0 (0)