Created
November 3, 2021 12:08
-
-
Save gbrits/8d962c0db7123ab7821d383c12d69dca to your computer and use it in GitHub Desktop.
Shopify Trailing Slash (SEO Optimisation)
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
{% 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 %} | |
{%- if canonical_url != blank -%} | |
<link rel="canonical" href="{{ canonical_url }}" /> | |
{% endif %} | |
{%- endif -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment