Shopify themes, liquid, logos, and UX
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.
Solved! Go to the solution
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
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
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.
Hi Pawan - anything for me please?
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!
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>
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.
It worked. I was doing the same thing. It didn't work before.
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
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024