How to Create Meta Tags Templates in Magento 2?

Sometimes, pages from the third position in SERP get more clicks than the second or even the first result. This eventually leads to that third page getting the first top position only because people find it more useful.

However, it doesn't happen randomly. How many clicks your page gets in search results depends on how well you optimize your meta tags. In terms of product page SEO, you have to optimize your meta titles and descriptions with keywords.

But the main question is, how do you optimize the metadata for each product if you have hundreds or even thousands of them?

The answer is — Magento meta tags templates. These templates are also known as the SEO rules that allow you to set up meta titles or descriptions as a template for certain kinds of products.

So, today you'll learn how to create meta tags templates with the Magento SEO Extension.

To create Magento 2 meta tags templates:

1. Navigate to Marketing > SEO by Magefan > SEO Rules and press on the Add New SEO Rule button.

Manage SEO rules Magento

2. Enable a rule and give it a Name.

3. Specify the Priority of the template. The greater the number the later the rule will be processed. 

4. Choose whether to Override Existing Attributes Values.

Note: by default, the rule will be applied only if the attribute is empty or its value equals the category/product name. Set Yes if you want to override existing attribute values.

5. Select the Page Type to create the template for products or categories.

new seo rules magento

6. Specify the templates for:

  • H1 Title 
  • Description
  • Short Description 
  • Meta Title
  • Meta Description
  • Meta Keywords

Note: you don't have to fill out all the fields, just the ones you need to create templates for e.g. meta titles and descriptions or only the H1 tags.

meta tags templates magento seo

If you want to set any specific robot instructions for those pages, you can benefit from the Meta Robots option. And if you wan to change the canonical for a specific page, specify the custom Canonical URL.

Besides, you can find all the relevant attributes using the Attribute List Search.

set rules in magento 2

7. Set what Store Views to assign the template for in the Display Settings section. You can create different templates for each store view.

SEO rules display settings

8. Set the Conditions based on product attributes to define what products to apply the templates for.

Magento SEO rules

e.g. you can create different templates for New or Sale products.

Once you finish setting up the conditions you can Preview products the template will be applied to. You'll see the generated metadata on these products. 

Preview meta tags temlates

Don't forget to Save Config and check how your product page is displayed in search using any metadata preview tool. 

Based on the meta tags templates you've set, you should see optimized results for categories or products. 

Magento Product SEO h1 Tag

Just imagine how much time you'll save if setting meta titles and descriptions for multiple products and categories gets down to a few clicks.

With the Magento SEO Extension, you don't have to get fussy about each SEO-related feature. You can configure them easily with a few simple options. Check out our live demo and see how it works.