SEO Title (Site Name) for shopify store on Google Search

dre88
Visitor
2 0 2

Hi there, I would really appreciate some help here.

 

I have been trying to edit the theme.liquid to reflect the title of my store to the business name. however it is now only still showing the domain name when doing a google search. I believe in Google they call it site name?

 

For reference please refer to this link https://developers.google.com/search/docs/appearance/site-names to be more clear what I am referring to (in this case the Lorem Ipsum area in the image).

 

Here is my existing liquid code as well.

 

<!-- Title and description ================================================== -->
{%- capture seo_title -%}
{{ page_title }}
{%- 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 -%}
{%- unless page_title contains shop.name -%}
&ndash; {{ shop.name }}
{%- endunless -%}
{%- endcapture -%}

 

Appreciated anybody who can help.

 

Replies 2 (2)

OneMobile
Shopify Partner
143 15 30

Hi @dre88 

 

The title of your site, which appears in search results, is determined by the metadata in your theme's code as well as how Google indexes your site. While editing your theme.liquid file is a start, the changes you make might not immediately appear in Google search results.

 

The code you've shared properly appends your shop name to the page title unless the page title already contains your shop name. Your code might not be the issue.

 

However, if you're certain that your business name should always be a part of your site's title, you can edit your theme's code to reflect this hard-coded preference as follows:

 

```html

{%- capture seo_title -%}

{{ page_title }} – {{ shop.name }}

{%- if current_tags -%}

{%- assign meta_tags = current_tags | join: ', ' -%} – {{ 'general.meta.tags' | t: tags: meta_tags -}}

{%- endif -%}

{%- if current_page != 1 -%}

– {{ 'general.meta.page' | t: page: current_page }}

{%- endif -%}

{%- endcapture -%}

```

This will ensure your shop name always appears, regardless of the page title. After making changes, it may take some time for Google to re-index your pages to reflect the changes in search results.

 

If the problem persists and if your business name is not reflected in Google Search, you might want to consider reaching out to Google via the Google Search Console, requesting a re-indexing of your site, or getting professional SEO help.

 

I hope that this helps!

If you find my answer helpful, please hit the Like button or Mark as solution to show me some encouragement.
OneMobile: The #1 Mobile App Builder For Shopify Merchants
Pick ready-made themes & customize with drag-n-drop editor.
Rasleen_Sahni
Tourist
8 0 4

Hi,

I'm trying to add this code to theme.liquid. I have a couple of queries:

1- does this code go within <title></title> tag, replacing the code already there?

2- I'm getting the message "The variable 'seo_title' is assigned but not used". What should I do?

 

I'm using Dawn 13.0 theme