Blog tags causing duplicate meta description issue

Oliv
New Member
5 0 0

I am running into the problem, where blog tags are creating issue with duplicate meta descriptions. It looks like all blog tags have the same meta description? Is there a way to either change individual blog tag description, or hide tags from being indexed? Please help!

0 Likes
PetrusB22
Shopify Partner
38 5 3
Hi, did you scroll to the bottom of your blog entry page? You can update the meta tags from there.
0 Likes
Oliv
New Member
5 0 0

This is not what I am referring to. I am not talking about meta tags for blog posts. I am referring to meta description and titles for the actual tags, that you add for each blog posts.

0 Likes
PetrusB22
Shopify Partner
38 5 3

Hi Oliv,

That is a bit strange. Would you mind sharing a link to your site? The tags are only supposed to be added as meta keywords and not have their own content.

0 Likes
Oliv
New Member
5 0 0

No, the tags are added as actual pages. Here is one example: https://appliedspeed.com/blogs/tech/tagged/afco-racing

0 Likes
PetrusB22
Shopify Partner
38 5 3

Hi, so I have been playing around with this and the tags use your default blog.liquid template to create the page. So all items in the "tech" blog category will have the same meta description.

I was able to come up with some sort of solution for this. I altered the code in the theme.liquid
from this:

{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}

to this:

{% if page_description != blank and blog.tags == blank %}
<meta name="description" content="{{ page_description | escape }}">
{% elsif blog.tags != blank and page_description == blank %}
{% for article in blog.articles %}
<meta name="description" content="{{ article.excerpt | truncate: '150' }}">
{% endfor %}
{% else %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}

You can copy this code and replace it inside your theme.liquid

What this does it checks whether or not the blog has tags and if it has tags, it creates a meta description from the filtered articles excerpts.

Please let me know if this resolves your issue.

0 Likes
Oliv
New Member
5 0 0

Unfortunately, that code didn't work. 

0 Likes
marlsg11
New Member
1 0 0

im having this same problem, did you ever find a solution?

0 Likes
AWM
New Member
1 0 1

Here's my solution for the same issue that will only change the meta on those tag pages - in theme.liquid replace:

if page_description %}
<meta name="description" content="{{ page_description | escape }}" />
{% endif %}

with the following:

{% if template == 'blog' and current_tags != blank %}
<meta name="description" content="COMPANY NAME blogs tagged with {{ current_tags.first }}.">

{% elsif page_description %}
<meta name="description" content="{{ page_description | escape }}" />
{% endif %}

 

This gives you a unique meta description for those tag pages but leaves the meta description as is for the actual blog pages.

Hope that helps!

arcform
Tourist
28 0 1

Where would I find this code on the minimal theme, as I am having the same problem but this code doesn't exist in my liquid file on minimal.

Any help would be much appreciated.

Jenny

0 Likes