All things Shopify and commerce
@Martin69Yes, I can help here. Could you please share the store URL?
Note: Backup your theme first, then
Access your Shopify theme files: Go to your Shopify admin panel, navigate to "Online Store" > "Themes," and click on the "Actions" dropdown next to your active theme. Then select "Edit code" to access the theme files.
Locate the product template: Look for the Liquid file that represents the product template. It is usually named product.liquid
or something similar. Open that file for editing.
Find the <title>
tag: Within the product template, locate the <title>
tag. It may look like <title>{{ product.title }}</title>
. We'll modify this to include the variant options.
Update the <title>
tag: Replace the existing <title>
tag with the following code
<title> {{ product.title }} | {% for option in product.options %} {% if option == "Stijl" %} {{ option }}: {{ variant.option1 }} {% elsif option == "Grootte" %} {{ option }}: {{ variant.option2 }} {% elsif option == "Materiaal" %} {{ option }}: {{ variant.option3 }} {% endif %} {% unless forloop.last %} - {% endunless %} {% endfor %} </title>
This code checks the option names and includes the corresponding variant values in the page title. It assumes that your option names match the ones you provided.
<meta name="description">
tag in the same product template and update it with the following code
<meta name="description" content="{{ product.meta_description | escape }}">
Dear Sellling Apps,
Thanks for the effort. We cannot find the <title> element in any product.liquid files except theme.js. We are using the Spark Theme and Gempages.
We would like to hire someone to fix this, instead of trial and error runs. Can you help us out?
Kind regards,
Martin
in product.liquid.
{% if product.selected_variant %}
{% assign variant_title = '' %}
{% for option in product.selected_variant.options %}
{% assign option_name = option.name %}
{% assign option_value = option.value %}
{% assign variant_title = variant_title | append: option_value | append: ' - ' %}
{% endfor %}
{% assign page_title = product.title | append: ' | ' | append: variant_title %}
<title>{{ page_title }}</title>
{% comment %}
Uncomment the following code if you also want to update the meta description
{% endcomment %}
{% assign meta_description = product.description %}
{% if product.selected_variant.title != product.title %}
{% assign variant_title_no_pipe = variant_title | remove: ' | ' %}
{% assign meta_description = meta_description | append: ' | ' | append: variant_title_no_pipe %}
{% endif %}
<meta name="description" content="{{ meta_description }}">
{% else %}
<title>{{ product.title }}</title>
<meta name="description" content="{{ product.description }}">
{% endif %}
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025