Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
I would need to decode the special characters of my page title. The product page is perfectly fine already. However, I would need for page title.
Example:
Input: Combat By test™ Example
Expected Output: Combat By test™ Example
I've used the below code to decode the page title. However, it doesn't work.
page: theme.liquid
<title>{{ page_title | url_decode }}</title>
Thanks
If these titles are being output for <html> content the entities should just work.
url_decode is for percent encoded characters for usage with URLS.
And not for html-entities for usage in <html> tags ;which oddly liquid does NOT support.
https://developer.mozilla.org/en-US/docs/Glossary/Entity
https://shopify.dev/api/liquid/filters#url_decode
https://github.com/Shopify/liquid/issues/859
If you must convert a lot of strings like this using liquid you'll basically have to make a big case/when statement doing string matching to return the desired string output. If performance minded be sure to test that snippet with the liquid profiler extension.
https://shopify.dev/themes/tools/theme-inspector
Though you may be better off changing strings at the source depending on what is trying to be achieved.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025