Duplicate <title> tags - how to remove shopify generated tag for proxy pages

jimkielife
New Member
3 0 0

Hi

I'm doing SEO analysis and I have one page on my site that is showing duplicate <title> tags. I have set the desired <title> tag within the app itself but shopify is also setting another one and this is impacting my SEO.

Im using the debut theme and the code that I believe is relevant is below from theme.liquid file:

 

 {%- capture seo_title -%}
  {% if template == 'list-collections' %}
  Collections - Product Categories | Jimkie Life
  {%- else -%}
      {%- if request.page_type == '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 -%}
      {% comment %} CODE FOR ADDING PAGE NUMBER TO SEO TITLE {%- if current_page != 1 -%}
        &ndash; {{ 'general.meta.page' | t: page: current_page }}
      {%- endif -%}{% endcomment %}
      {%- assign escaped_page_title = page_title | escape -%}
      {%- unless escaped_page_title contains shop.name -%}
        &ndash; {{ shop.name }}
      {%- endunless -%}

  {% endif %}
  {%- endcapture -%}

 

 From testing i've figured out that it is assigning this based on the value relating to page_title on line 8. I spoke with the 3rd party and they are telling me that it is because the app is embedded into a Shopify Proxy Page. As such, the <title> tag that Shopify is generating is my Shop name which must be the standard default.

My question is, how can I override this within the code above just for one webpage. Is it possible to set a page_title for an individual webpage by referring to its individual URL? Or is there a better way to do it?

My site page that I'm referring to is: https://jimkielife.com/community/faqs. If you inspect the code you'll find two <title> tags, the one which reads just "Jimkie Life" is being generated by Shopify and I somehow want this removing.

Thanks for any help that can be provided.

 

Jimkie Life

0 Likes
jimkielife
New Member
3 0 0

Anybody able to help me with this please?

0 Likes

@jimkielife 

 

Have you considered removing it dynamically with Javascript?

 

function removeDuplicateTitle(){
var titles = document.querySelectorAll(`head title`);

if (titles.length <= 1){
    return;
}

return titles[1].remove();
}

removeDuplicateTitle();

 

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes
Adrian67
New Member
1 0 0

I have the same issue with duplicate Title Tags. I wanted to ask where this js code would be inserted and would it permanently remove the second title tag? thanks

0 Likes