Change page title in search engine results

Hello,

I have been trying to correct this issue for almost a year now.

I would like to change the title name that appears on my website on any search engine page results.

My website is www.romaniandrinks.co.uk and the title appears RomanianDrinks.co.uk

This is what I have in the theme.liquid code:

{%- capture seo_title -%}
{%- if template contains ‘search’ -%}
{{ search.terms | replace: ‘*’, ‘’ | split: ’ AND ’ | last }} - {{ shop.name | escape }}
{%- else -%}
{{ page_title }}{% 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 %}{% unless page_title contains shop.name %} – {{ shop.name | escape }}{% endunless %}
{%- endif -%}
{%- endcapture -%}

{% if template contains "index" %}{{ page_title }}{% else %}{{ page_title }}{% if current_tags %} {{ 'general.meta.tagged_html' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} {{ 'general.meta.page' | t: page_number: current_page }}{% endif %}{% endif %}

And this is what I have in the Preferences of Shopify:

Any suggestions of what I should change?

1 Like

Hello @MAndreiD

The code you’ve shared from the theme.liquid file is managing the SEO title dynamically based on the page context, tags, and pagination.

If you’re looking to troubleshoot or adjust this:

  1. SEO Title Logic:

    • The seo_title variable is capturing a customized title based on the page type (e.g., search page, specific tags, pagination).
    • Make sure the logic reflects what you want displayed for each type of page.
  2. Shopify Preferences:

    • Navigate to Online Store > Preferences in your Shopify admin to verify or update your default meta title and description.
    • These settings act as a fallback or base for your site.
  3. Adjusting Meta Tags:

    • If you need specific titles for certain pages, you may need to edit their corresponding templates or pages directly in the Shopify admin.
  4. Testing the Output:

    • After making changes, use the Shopify theme preview or publish to check how the titles appear.
    • You can also inspect your page’s HTML source (Ctrl+U or Cmd+U in most browsers) to confirm the output.

Hi @devcoders

Thanks for your reply. Unfortunately this is not what I was looking for.

I’m interested in changing the text that appears above the link to the website as shown in the above screenshot.

Hi @MAndreiD ,

1. Shopify Preferences

The title and meta description settings in Shopify Preferences directly affect how your website appears in search engine results. Here’s how to review and edit them:

  1. Go to Online Store > Preferences in your Shopify admin.
  2. Look for the Title and Meta Description section.
  3. Ensure the title field is set to the text you want displayed in search engine results. For example:
  4. Update the meta description field with relevant information that accurately describes your website. This will help improve how your site is displayed in search results.

2. Review and Edit the theme.liquid File

Your theme.liquid file currently has a dynamic SEO title setup. To make it more static or specific to your website, you can modify the code to ensure the correct title appears consistently.

Suggested Changes:1. Replace the tag with this updated code to ensure the title appears consistently:

{%- if template == 'index' -%} Buy Authentic Romanian Drinks - RomanianDrinks.co.uk {%- else -%} {{ page_title }}{% if current_tags %} - {{ current_tags | join: ', ' }}{% endif %} - RomanianDrinks.co.uk {%- endif -%}
  1. Ensure the {% capture seo_title %} block has the desired static title logic for search engines, like this:

    {%- capture seo_title -%} {%- if template == ‘index’ -%} Buy Authentic Romanian Drinks - RomanianDrinks.co.uk {%- else -%} {{ page_title }}{% if current_tags %} - {{ current_tags | join: ', ’ }}{% endif %} - RomanianDrinks.co.uk {%- endif -%} {%- endcapture -%}


3. Submit Changes to Search Engines

Even after correcting the title, it may take time for search engines to reflect the updates. To speed this up:

  1. Submit your site to Google Search Console:

  2. Ensure Proper SEO Tags: Use an SEO app like Yoast SEO or SEO Manager to validate your titles and meta tags.


4. Debugging Tips- Use Google Search Preview to check how your page will appear in search results.

  • If the issue persists, ensure there is no conflicting app or code overriding your theme.liquid changes.

Hi @MAndreiD

After checking the question you raised here, I see that the content of your shared meta title and meta description code has been modified by other apps. Please note that Shopify has its code content to display the meta tags properly. Here is the original code you can find from the original version of theme.liquid file below for your reference.


    {% if page_description %}
      
    {% endif %}

I suggest you replace the code content mentioned in the question with what I shared, and in this way, it can help display your meta title and meta description properly. After that, it is better to submit your sitemap again through Google Search Console, so that it can help you get the updated result in Google efficiently.

By the way, if you decide to use SEO APP for further page optimization, you can consider SEOAnt, as it will not insert or edit any codes on your website and it has SEO Checker feature to detect and analyze page contents to help you get more organic traffic and conversion rate. The 7-day Free Trial and 30% discount SEOAnt 30% Jeffery support here, kindly have a try and test it, thank you!

Hello Jeffrey,

I appreciate your response. Before I make any changes to the code, I can confirm you with which part of the code needs to be replaced by the one you’ve provided? Is this the one in bold below?

{%- if settings.favicon -%}

{%- endif -%}

{%- capture seo_title -%}
{%- if template contains ‘search’ -%}
{{ search.terms | replace: ‘*’, ‘’ | split: ’ AND ’ | last }} - {{ shop.name | escape }}
{%- else -%}
{{ page_title }}{% 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 %}{% unless page_title contains shop.name %} – {{ shop.name | escape }}{% endunless %}
{%- endif -%}
{%- endcapture -%}

{{ seo_title }}

{%- if page_description -%}

{%- endif -%}

{%- liquid
render ‘open-graph’
unless settings.disable_microdata
render ‘microdata-schema’
endunless
-%}

Hi @MAndreiD

The one in bold mentioned in your reply is related to another code below:

{%- capture seo_title -%}
{%- if template contains ‘search’ -%}
{{ search.terms | replace: ‘*’, ‘’ | split: ’ AND ’ | last }} - {{ shop.name | escape }}
{%- else -%}
{{ page_title }}{% 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 %}{% unless page_title contains shop.name %} – {{ shop.name | escape }}{% endunless %}
{%- endif -%}
{%- endcapture -%}

You can also check my shared screenshot here to better understand their relationship.

Therefore, please replace the part of code below

{%- capture seo_title -%}
{%- if template contains ‘search’ -%}
{{ search.terms | replace: ‘*’, ‘’ | split: ’ AND ’ | last }} - {{ shop.name | escape }}
{%- else -%}
{{ page_title }}{% 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 %}{% unless page_title contains shop.name %} – {{ shop.name | escape }}{% endunless %}
{%- endif -%}
{%- endcapture -%}

{{ seo_title }}

{%- if page_description -%}

{%- endif -%}

with the one I provided from the original version of theme.liquid file


    {% if page_description %}
      
    {% endif %}

If you still have further questions or confusing parts, feel free to reply here, thank you!

Hi Jeffery,

I have proceeded to change the code as suggested by you (this was back in March) but Google results still show romaniandrinks.co.uk instead of Romanian Drinks as the title of website.

Here’s a screenshot of the theme.liquid file.

What are your thoughts?

1 Like

Hi @MAndreiD

You have done a good job of meta tags optimization on the website in the past three months since March! The meta title and meta description contents should be displayed properly in the search results after your modification.

At present, you would like to further change the website’s title in the search result from romaniandrinks.co.uk to Romanian Drinks. Then, you need to use Structured Data to add your site name, “Romanian Drinks,” and let Google know your changes. This action needs the assistance from developers, and to let you know better how it works, I can share with you an example of Website structured data that includes the required fields and a guideline for your reference:


  
    
    
  
  
  

Feel free to ask me here if you still have further questions @MAndreiD . Thank you!