Skip to content

Instantly share code, notes, and snippets.

@jinesh24
Created July 11, 2019 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinesh24/8e118849c8dd162a9e92d28352c24749 to your computer and use it in GitHub Desktop.
Save jinesh24/8e118849c8dd162a9e92d28352c24749 to your computer and use it in GitHub Desktop.
Shopify Collection Tags Duplicate Content Fix
{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ collection.url }}" />
{% elsif template contains 'blog' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ blog.url }}" />
{% else %}
<meta name="robots" content="index,follow">
<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