LeftyLuke
Regular Member
- Jun 13, 2017
- 281
- 62
A nr. of URLs are being indexed that I don't want to... But since it is impossible to edit the robots.txt file shopify says in this guide to hide a url you should put the following code in the header of your template:
Now I want to exclude all strings that contain "?variant=" in the URL so I was thinking to put the code like this:
But that doesn't seem to work, anybody experienced with Shopify who knows how I would go about achieving this?
Cheers
Code:
{% if handle contains 'page-handle-you-want-to-exclude' %} <meta name="robots" content="noindex"> {% endif %}
Now I want to exclude all strings that contain "?variant=" in the URL so I was thinking to put the code like this:
Code:
{% if handle contains '/?variant=' %} <meta name="robots" content="noindex"> {% endif %}
But that doesn't seem to work, anybody experienced with Shopify who knows how I would go about achieving this?
Cheers