Product Vendor in Page Title (Turbo theme) SEO

LaurenMcCreery
Excursionist
33 1 5

Hi there,

I'm launching a new website, www.lespetits.fr very soon. By default, the Product Vendor does not appear in the Page Title for SEO purposes, only the product name. My store is a multi-branded store, with desirable brands, so I need this for SEO. If i include the Vendor in the product name, it makes it very long. I saw someone a while ago post some code to automatically pull through the Product Vendor to the Page Title, but have no idea where to put this in the backend. Can anyone help please?

Many thanks,

Lauren

Replies 2 (2)

KieranR
Shopify Partner
333 27 116

Find the <title> tag in your theme. 

It might look something like this:

  {%- capture seo_title -%}
    {%- 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 -%}
    {%- 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 -%}
  <title>{{ seo_title | strip }}</title>

Change to this: 

  {%- capture seo_title -%}
    {%- 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 -%}
    {%- if current_page != 1 -%}
      &ndash; {{ 'general.meta.page' | t: page: current_page }}
    {%- endif -%}
    
  	{% if template contains 'product' %}
  		&ndash; {{product.vendor}}
  	{%- endif -%}
  	
    {%- assign escaped_page_title = page_title | escape -%}
    {%- unless escaped_page_title contains shop.name -%}
      &ndash; {{ shop.name }}
    {%- endunless -%}
  {%- endcapture -%}
  <title>{{ seo_title | strip }}</title>

 

Check it shows how you want. Assuming ALL products have a Vendor specified and the naming convention makes sense accross the board. If not, there are other ways to approach it using liquid conditionals like IF Vendor not blank or IF tag exists or IF vendor not xyz THEN use this title tag pattern, ELSE use this pattern. 

Every theme tends to have a slightly different title block, so the above may not work directly, but is an example of one way it can be done.

Full time Shopify SEO guy, based in NZ. Sometimes freelance outside the 9-5.
LaurenMcCreery
Excursionist
33 1 5

Thank you so much Kieran, much appreciated. I've sent you a private message re a quote for this work if possible. 

Thanks,

Lauren