How to set up meta tag templates and use variables
A meta tag template is one pattern for the meta titles and meta descriptions of a page type, with variables that the app replaces by each page's own data. This article shows how to write a template, which variables you can use, how the preview works and what the app checks before it saves.
Before you start
- There is one template per page type: products, collections, pages and blog posts.
- Saving a template does not change your pages. Nothing is written until you apply the template to existing pages. See How to fill empty fields from templates.
- A template is plain text with variables in double braces. The app only swaps the variables for text. It does not run code or logic.
Create and save a template
- Go to On-page settings and open Meta tags.
- In Page type, choose a type. If it has no template yet, you see "No products template yet" (or the same for another type).
- Select Create product template. A starter template is added, for example the page title, a separator and your store name for the title, and the first sentence of the description for the description.
- Edit Meta title and Meta description. Select a variable chip to add the variable to the end of the field you edited last. A toast confirms the insert.
- Check the preview on the right, then save. The toast says "Template saved".
You can write only a title template or only a description template.
Variables by page type
Write a variable as {{ product.title }}. Spaces inside the braces do not matter.
| Page type | Variables |
|---|---|
| Products | product.title, product.type, product.vendor, product.price, product.description, variant.option1, shop.name |
| Collections | collection.title, collection.description, shop.name |
| Pages | page.title, page.content, shop.name |
| Blog posts | article.title, article.excerpt, blog.title, shop.name |
Details:
product.priceis the lowest price among the variants, in your store's money format.variant.option1is the first value of the product's first option. A "Default Title" option is ignored.- Descriptions, content and excerpts can use the filter
| first_sentence, for example{{ product.description | first_sentence }}. It keeps the text up to the first full stop, exclamation mark or question mark. If there is none, it uses the whole text. No other filter exists.
How the result is built
- Extra spaces are removed. If a variable is empty, a separator such as a dash, bar, dot or comma left hanging at the start or end, or doubled, is cleaned up.
- A meta description is cut at a word boundary within 160 characters.
- A meta title is only cut if it runs over 255 characters (at a word boundary). The preview shows its length.
- If the result is empty, nothing is written to the page.
Use the preview
The preview shows a Google-style result built from one real page. To change the page, select Change next to Preview with and pick another in the dialog Preview the template on. You can search by title or handle and sort the list. Select Use this product (or the matching type) to update the preview.
The title note reads "As Google sees it: N / 60 characters". If your theme adds your store name, the note says which text it adds.
What the app checks before saving
| Message | What to fix |
|---|---|
| "product.colour" isn't a variable. Use product.type or a product option. | Use a variable from the table above |
| Every product would get this same text, and "2026" goes out of date. Add a product variable such as {{ product.title }} and leave out the year. | Add a variable that differs on each page and drop the year |
| "2026" goes out of date. Leave out the year. | Remove a fixed year |
| Check the {{ }} around each variable. | Close every {{ with }} and use only the filter above |
| Write a meta title or a meta description template. | Fill at least one field |
Apply the template
Under Apply to existing products (or another type), select the apply button, choose which fields the template may write and confirm. A progress bar shows the job. You can undo it from History.
[!INFO] New products and collections can also be filled automatically. See How to fill new products and collections automatically.
The Coverage card on the right shows how many meta descriptions were written by you, by a template or by import.