Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
I've been researching this topic endlessly and thought I had arrived at a solution but Screaming Frog indicates my solution was not successful.
Problem: I used tags to filter my collections pages - by everything from subcategory to brand to product features. The result, I discovered, was the creation of dozens and dozens, maybe hundreds, of additional collection URLs for each possible permutation of tag filters. I understand this is problematic for SEO. I would like to make the collection page URL, with no tag filters, the canonical.
Proposed Solution: I found the following code described somewhere as the solution:
{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
However, I crawled my site with Screaming Frog and found that the canonical link element is still listed as the URL with the tags included. The crawler does recognizes the "noindex" instruction but it still seems to be listing the canonical link element as the full URL with the tag filters.
Example of Tag Filter URL:
Desired Canonical:
Make sure the double-quotes in the code used in your theme are "straight quotes", and not “curly quotes”.
I had copied the exact same code you are using in your post, but from a page that rendered the quotes as curly quotes. I didn't catch it in the theme.liquid (the visual difference is very subtle).
Once I pulled the code into a code editor, it was apparent that they were curly quotes, and using the straight-quotes version immediately fixed the rel=canonical not being altered, just as you were experiencing.
Copy the version below to make sure you are using code that uses straight quotes.
{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
Hi there, we've developed a theme and filter page technology that overcomes one of Shopify's biggest technical SEO issues. You can learn more here: https://www.integritycommerce.com/
i am having this exact issue! Ive tried the code but they still show as indexed pages. Does the update require time to work or should it be instant? This is driving me insane!!!
Hi there,
We have developed the only theme in the world that allows you to fully optimize filter/tag pages with unique:
- URL's
- Meta titles
- Meta descriptions
- H1's
- Indexable content
- Alt= tags
You can learn more about this world's first tech here: https://www.aaptheme.com
Feel free to reach out here if you have any questions - kma@integritysearch.co.uk
Kristin
@mdbing What is an example page? And what canonical code are you using?
The moment you save your theme, it will update on your website. However, it will take Google an unknown amount of time to crawl each of the pages to see the updated version where it recognizes pages as noindex.
Hi @mdbing, here's where your problem lies. You have incorrect metadata on the page and you have not 1, but 3 canonical tags on the page which are all conflicting with each other. You have 2 self canonicalizing tags and one correct one.
If you canonical tag is correct [use the 1st one] then you won't need the noindex tag.
Whichever app you are using is not outputting the meta title data correctly, assuming you are using one.
No problem - kindly let me know how you get on. We also offer some free email Shopify SEO training which includes 'how to audit your whole site'. This may be of use to you too:
https://www.ecommerceseomasterclass.com/enroll
Just had a quick look and all 3 canonicals are still there.
Why does that link go to Click Funnels and not a theme page?
Surely if you were true to your approach about a great product, you wouldn't link to a dodgy MLM landing page tool business thing.
Do you have any examples of a known business that uses this theme so we can see it in action and also we can test the page speed of it?
I was interested then got click funnels and thought ALARM BELLS
Man, I am more than grateful, You saved us, I search a whole day for this Until your solution helped us. GOD bless you from khashayar
User | RANK |
---|---|
8 | |
4 | |
4 | |
3 | |
2 |