Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shopify SEO - attempt to avoid duplicate meta descriptions
Change to make in theme.liquid
It adds a canonical tag for tag-filtered pages, back to the base collection/blog page.
*** Find this is the standard canonical tag code: ***
<link rel="canonical" href="{{ canonical_url }}" />
*** Completely replace it with this: ***
{% if template contains 'collection' and current_tags %}<meta name="robots" content="noindex" /> <link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% elsif template contains 'blog' and current_tags %}<meta name="robots" content="noindex" /> <link rel="canonical" href="{{ shop.url }}{{ blog.url }}" />
{% else %}<link rel="canonical" href="{{ canonical_url }}" /> {% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.