All things Shopify and commerce
Hello,
I just noticed that some URL pages of my website are indexed with the tag of filters, as well as our regular pages. How can I explain to google, to do not index those pages with filters/tags?
For example, I have a meta title on google: E-Shop - My Website - Tagged "category__outerwear, size__ ...
and a URL: https://mywebsite.fr/collections/all/size__xxl%20category__outerwear
Can you help?
Best,
Nicolas.
Yeah I've just come across this and am wondering 1) whether it is a problem? 2) how I can fix it if so. I'm going to keep searching by am not an expert - let me know if you have come across anything! 🙂
Same here - is there a way to locate the filter and set rules? So far I can use metafield with noindex set to false or true, but I don't want to filter pages to be indexed.
Hi, I have tried with the next code in theme.liquid but is not working;
{% if template contains "collection" and collection.handle == "?filter" %}
<meta name="robots" content="noindex, follow">
{% endif %}
{% if handle contains '?filter=' %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
Any help?
I also blocked it in robots.txt with;
{{ 'Disallow: /collections/*?*filter*' }}
Try
{% if template contains "collection" and collection.handle contains "?filter" %}
?
Try this set in your theme header - you can modify to fit your needs.
- note I also set metafield to collection or page so it is a quick solution for you too.
{% if handle contains 'types' or template contains 'search' or template contains 'cart' %}<meta name="robots" content="noindex, nofollow" /><!-- ID: search-type-cart -->
{% elsif product_url contains 'view=list' %}<meta name="robots" content="noindex, nofollow" /><!-- ID: view-list -->
{% elsif request.page_type == 'collection' or request.page_type == 'page' %}
{% if template contains 'collection' and current_tags %}<meta name="robots" content="noindex, nofollow" /><!-- ID: tags-filter -->
{% elsif template contains 'collection' and product_url contains 'page=' %}<meta name="robots" content="noindex, nofollow" /><!-- ID: collection-pagination -->
{% elsif collection.metafields.robots.noindex == 'false' or page.metafields.robots.noindex == 'false' %}<!-- indexed collection / page by metafield" -->
{% else %}<meta name="robots" content="noindex, nofollow" ><!-- ID: meta-field-default-noindex -->
{% endif %}
{% elsif product_url contains 'variant=' or product_url contains 'currency=' %}<meta name="robots" content="noindex, nofollow" /> <!-- ID: variants & currency -->
{% else %}
{% endif %}
I have the same problem and tried everything. The problem is that the URL for filtered collection pages contains a question mark (?) which is not in Shopify's URL handle so you can't target it with this code.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025