Blog post titles also show blog name - making the title really long

mayajacquez
Visitor
2 0 0

Hi, the title tags of my blog posts are way too long.

For example for this blog post, my title is What is Pinole? But when I use a heading tag checker, the title shows up as the following.

What is Pinole? | The Pinole Project | High Protein/Fiber, Vegan, Gluten Free Aztec Superfood Pinole Chia Oatmeal

I'm trying to fix my seo and this is one of the main issues I'm seeing on my Shopify. Any idea how to fix this to make the title show up alone and not with my website name and description?

Thanks!

 

Replies 3 (3)
Bunty
Shopify Partner
133 39 73

Page title is set using Liquid, in your theme, Debut, if you look in the theme.liquid code, you will find

<title>{{ seo_title | strip }}</title>

 

Somewhere above that, the 'seo_title' would be defined as somthing like this

{%- capture seo_title -%}
    {%- if template == 'search' and search.performed == true -%}
      {{ 'general.search.heading' | t: count: search.results_count }}: {{ 'general.search.results_with_count' | t: terms: search.terms, count: search.results_count }}
    {%- else -%}
      {{ page_title }}
    {%- endif -%}
    {%- if current_tags -%}
      {%- assign meta_tags = current_tags | join: ', ' -%} &ndash; {{ 'general.meta.tags' | t: tags: meta_tags -}}
    {%- endif -%}
    {%- if current_page != 1 -%}
      &ndash; {{ 'general.meta.page' | t: page: current_page }}
    {%- endif -%}
    {%- assign escaped_page_title = page_title | escape -%}
    {%- unless escaped_page_title contains shop.name -%}
      &ndash; {{ shop.name }}
    {%- endunless -%}
{%- endcapture -%}

 

so essentially, it is taking the page title, appends the shop name if it isn't appended already and then add tags

If you want to conditionally change it for a blog page, this would be the place to do so

mayajacquez
Visitor
2 0 0

OK, I see. I would like to remove my store name from the end of ALL my page titles. What code would I use to do that? Or what would I need to take out from the code? Thanks in advance.

Bunty
Shopify Partner
133 39 73

Simply remove this part

{%- unless escaped_page_title contains shop.name -%}
      &ndash; {{ shop.name }}
{%- endunless -%}