-
-
Save jonathanmoore/217fd7c0d62b6833f159ad31f8c312da to your computer and use it in GitHub Desktop.
Shopify SEO - attempt to avoid duplicate meta descriptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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