Orange Collar Media
Orange Collar Media
DOCS
OCMLABS/MODULE-SEO · META TEMPLATES

Magento meta title and description templates for products, categories, and CMS pages

  • Magento
  • Adobe Commerce
  • Hyvä

A meta template fills in a page’s title or description when the page has none of its own. A large catalog rarely has a hand-written meta title on every product; a template such as {{name}} {{sep}} {{store_name}} gives every one of them a sensible title without touching the products themselves.

Templates are set in Stores > Configuration > OCM Labs > SEO > Meta Templates, one title and one description template each for products, categories, and CMS pages, at default, website, or store view scope.

How-to: meta title and description templates, 0:59

Which value wins

  1. A meta title or description entered on the product, category, or page always wins.
  2. Otherwise, the matching template is rendered with the page’s data.
  3. If the template is empty, Magento’s own value is left in place.

Templates are applied when the page is rendered and are never saved into your products, categories, or pages. Change a template and every page that relies on it changes with it, once the full page cache is flushed.

Variables

VariableValue
{{name}}Product or category name, or CMS page title
{{sku}}Product SKU (products only)
{{price}}Product price (products only)
{{category}}Category name; for a product, the category it is viewed in, otherwise its first assigned category
{{parent_category}}Name of the parent category (empty for top-level categories)
{{store_name}}Store view name
{{sep}}The Separator set in configuration, | by default
{{attribute:<code>}}The storefront value of an attribute, for example {{attribute:short_description}}

Empty or unknown variables render as nothing, and a separator left dangling by an empty variable is removed, so {{name}} {{sep}} {{category}} on a product with no category renders as just the name. Output is plain text.

Which attributes can be used

{{attribute:<code>}} works for:

  • Any product or category attribute with Visible on Catalog Pages on Storefront set to Yes.
  • An allowlist that always works: name, sku, short_description, description, meta_title, meta_description, manufacturer, color, and size.

Back-office-only attributes such as cost are never exposed. For CMS pages, {{attribute:<code>}} works only for title, content_heading, meta_title, meta_description, and meta_keywords.

Defaults

Page typeTitle templateDescription template
Product{{name}} {{sep}} {{store_name}}{{name}} at {{store_name}}. {{attribute:short_description}}
Category{{name}} {{sep}} {{store_name}}Shop {{name}} at {{store_name}}.
CMS page{{name}} {{sep}} {{store_name}}(empty)

Examples

A product title that leads with the name and adds the brand:

{{name}} by {{attribute:manufacturer}} {{sep}} {{store_name}}

A category description:

Shop {{name}} in {{parent_category}} at {{store_name}}. Free returns on every order.

Templates and the SEO panel

The SEO panel scores the page’s own meta title and description. A page that relies on a template has an empty meta title, so the panel’s title checks fall back to the name, and the description checks see an empty description. Write a meta title and description for the pages that matter most and let templates cover the rest of the catalog.