Solved

Is there a way to change Page <title> for All The Products?

hellomenew
Excursionist
17 2 4

Hi Guys,

 

Is there a way to update Page Title <title> through Edit Code option?

 

I want to add word " - Wholesale" in all my product Page Titles. I have already added the same in my products Title: https://creedvintage.com/products/g73a-leather-jackets

 

Please guide.

Accepted Solution (1)

pawankumar
Shopify Partner
500 63 90

This is an accepted solution.

Hi @hellomenew 
On the product page backend, at the bottom. you will find "Search engine listing" section, you can update your page title from there.
and to update it via code for all products, in theme.liquid, you will find {{ page_title }} replace it with

{% if template contains "product" %}
{{ page_title | append: " - Wholesale"}}
{% else %}
{{ page_title }}
{% endif %}

Please check if it works for you

Thanks & Regards
Pawan

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

View solution in original post

Replies 8 (8)

pawankumar
Shopify Partner
500 63 90

This is an accepted solution.

Hi @hellomenew 
On the product page backend, at the bottom. you will find "Search engine listing" section, you can update your page title from there.
and to update it via code for all products, in theme.liquid, you will find {{ page_title }} replace it with

{% if template contains "product" %}
{{ page_title | append: " - Wholesale"}}
{% else %}
{{ page_title }}
{% endif %}

Please check if it works for you

Thanks & Regards
Pawan

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
hellomenew
Excursionist
17 2 4

Hi Pawan,

 

This one works well.

 

But when I add this code homepage and other collection pages titles repeat itself.

 

For example, the collection page was <title>Pawan Kumar is the best</title>

 

It shows like this <title>Pawan Kumar is the best - Pawan Kumar is the best</title>

 

For products title shows 1 time with Wholesale which is good.

 

Could you please help me with that.

hellomenew
Excursionist
17 2 4

Hi Pawan - anything for me please?

pawankumar
Shopify Partner
500 63 90

Hi @hellomenew 
You have to replace the {{page_title}} with above code, since we are just using the page_title conditionally, so it should appear only once and for products it should suffix with " - Wholesale"
Please check if you are doing it correctly

Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
hellomenew
Excursionist
17 2 4

Hi Pawan,

 

I exactly copied the same code and replaced {{page_title}}.

 

It is working perfectly for the products page.

 

However, the problem is, collections and homepage titles are showing twice. In the admin panel it is just showing once, but in the source code it shows twice.

 

Collection Page Title <title>Pawan Kumar is the best - Pawan Kumar is the best</title>

Admin Panel shows <title>Pawan Kumar is the best</title>

hellomenew
Excursionist
17 2 4

Also, I wanted to add, before editing the code Homepage and Collection pages Titles are just showing once.

 

Once I use your given code, product pages <title> works perfectly but other pages on the website duplicate the titles and show it twice. Which is strange.

hellomenew
Excursionist
17 2 4

It worked. I was doing the same thing. It didn't work before.

WebDeskSolution
Shopify Partner
172 42 49

Hello @hellomenew 

 

Please follow the steps below:

 

Step 1: Open the code editor and search for main-product.liquid section file

Step 2: Find {%- when 'title' -%} case and under that you can find {{ product.title | escape }} 

Step 3: Write your custom text next to {{ product.title | escape }}. Just like {{ product.title | escape }} {{ ' - Wholesale '}}

Step 4: Hit the save button and check for the result on the product page.

 

Reference video: https://www.awesomescreenshot.com/video/27223190?key=2d2f9f0308f0cad9cdde42ea3de4e674

 

Please hit Like and Mark it as a Solution if you find our reply helpful.

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9