Magento 2 SEO Meta Templates Manual¶
Introduction¶
SEO Meta Templates for Magento 2 extension lets you quickly and effectively manage a large number of important SEO data for the website. With the module, the store owner can create up to 16 different template types that apply store attributes on the fly to make your product / category / category filter pages unique and SEO-friendly.
The store owner can create templates for any product / category meta information and other important SEO elements, such as product name, product URL key, etc. On top of that, the extension is capable of optimizing the meta information and description for any filtered page, on any store view.
Requirements and Installation¶
SEO Meta Templates supports Open source (Community), Commerce (Enterprise) editions and Commerce cloud. The current version of the Magento installed on your website can be found in the lower right corner of any backend page.
SEO Meta Templates has 3 separate ways of installation:
1) Copy the code (ready-to-paste package);
2) Use MageWorx Repository;
3) Use local Composer.
Extension Configuration¶
The extension provides the possibility to edit the templates for the products, categories and category filters.
Product Templates¶
To view, edit and add the product templates, go to MARKETING ⟶ MageWorx SEO Templates ⟶ Product Templates.
To create a new product template, click the Add New Product Template button.
The Reference provides the possibility to generate the template for:
- Product SEO Name (H1)
- Product URL Key
- Product Short Description
- Product Description
- Product Meta Title
- Product Meta Description
- Product Meta Keywords
- Product Image Titles
Also, from here, the store owner can choose the Store View this template will be applied to.
Hit the Continue button to continue.
Check the name of the template as it provides the quick information regarding the conditions selected on the previous step.
Depending on the value of the Assign Type setting, the configuration of the product template may have the second tab or not.
In case the All Products is selected, the tab is hidden.
If the store owner wishes to specify the products and select the Attribute Set value, the Attribute Sets tab appears.
The store owner can select the desired Products attribute set.
In case the store owners wish to specify the exact products to be matched, they can select the Specific Products value. If selected, the Products tab appears.
Here, one can see the default products grid with the possibility to use the standard Magento filters functionality to easily find the necessary products.
The templates settings are the same regardless of the Assign Type value.
The Name settings is the merely informative meaning as it is shown only in the templates grid.
The Template Rule is the main mechanism to specify the desired template pattern.
-
The SEO Name and URL key support the product attributes. The basic structure is
[attribute]
likePurchase [color] [year] [make] [model] [engine] for only [price]
.This will be transformed into
Purchase grey 2018 Subaru Outback 2.5-liter for only $24,999
In case some attribute is not populated for all the products, the structure like
[attribute1|attribute2|attribute3|...]
is used. For instance, structure like[manufacturer|brand]
is logically parsed as "if the first attribute value is not available for the product, the second will be used and so on untill it finds a value".If the store owner needs to populate some word structure only in case the product has some attribute, the structure
[prefix {attribute} suffix]
can be used.Purchase [this wonderful {color}] [make] [model] for only [price]
means that this structure will be transformed into
Purchase Subaru Outback
or
Purchase this wonderful grey Subaru Outback for only $24999
in case the product has the
[color]
attribute.Randomizer feature is available. The construction like
[Buy||Order||Purchase]
will use a randomly picked word for each next item when applying a template. Also randomizers can be used within other template variables like[for only||for {price}]
. Number of randomizer blocks is not limited within the template. -
The Description and Meta data support the above-mentioned variables and variables like:
•
[category]
- outputs a current category name;•
[categories]
- outputs a current categories chain starting from the first parent category and ending a current category likeElectronics - Cell Phones
;•
[website_name]
- outputs a current website name;•
[store_name]
- outputs a current store name.Note that
[category]
and[categories]
variables get populated only in case the category path is added to the product URL. To check this setting, go to STORES ⟶ Configuration ⟶ CATALOG ⟶ Catalog ⟶ Search Engine Optimization.Use Categories Path for Product URLs is enabled in this example.
[categories]
variable outputs a current categories chain starting from the first parent category and ending a current category likeElectronics - Cell Phones
.Note that
[description]
and[short_description]
are the product attributes as well and can be used in the templates.
From here, the store owner can choose the values whether to apply the template to All products or to the ones with the Empty values.
The Apply By Cron setting schedules its auto-apply using Mageto Cron. To configure Cron in Magento 2, you can check this guide.
After a template is created, click the Save button.
Select the created template and hit the Test Apply button in the dropdown. Thus, you will test the template before it gets applied.
To apply the template, click the Apply button.
Use Cases
Click here to see the practical Use Cases of this functionality.
Category Templates¶
To view, edit and add the category templates, go to MARKETING ⟶ MageWorx SEO Templates ⟶ Category Templates.
Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
The grid supports mass actions. For this, click the checkboxes near the templates that you wish to modify and click the Edit link on the Actions dropdown. When the edits are done, click the Save Edits button to proceed.
To create a new category template, click the Add New Category Template button.
The Reference provides the possibility to automatically optimize Category SEO Name (same as H1 tag), category description (will appear in the frontend) and category meta data.
Also, from here, the store owner can choose the Store View this template will be applied to.
Hit the Continue button.
Check the name of the template as it provides the quick information regarding the conditions selected on the previous step.
Depending on the value of the Assign Type setting, the configuration of the category template may have the second tab or not.
In case the All Categories is selected, the tab is hidden.
If the store owner wishes to specify the categories and select the Specific Categories value, the Categories tab appears.
The store owner can type the desired categories in the categories field and then select one of the suggested options.
The templates settings are the same regardless of the Assign Type value.
The Name settings is the merely informative meaning as it is shown only on the templates grid.
The Template Rule is the main mechanism to specify the desired template pattern.
-
The Category SEO Name and Category Meta Keywords support these attributes:
•
[category]
- outputs a current category name;•
[categories]
- outputs a current categories chain starting from the first parent category and ending a current category likeElectronics - Cell Phones
;•
[website_name]
- outputs a current website name;•
[store_name]
- outputs a current store name;•
[store_view_name]
- outputs a current store view name;Randomizer feature is available. The construction like
[Buy||Order||Purchase]
will use a randomly picked word for each next item when applying a template. Number of randomizer blocks is not limited within the template. -
The Category Description, Category Meta Tile and Category Meta Description support the above-mentioned variables and variables like:
•
[parent_category]
- outputs a parent category name;•
[parent_category_1]
- outputs the first parent category name. It equals to [parent_category]. [parent_category_2] - outputs the second parent category name, etc. The orders of the parent categories is as follows:www.site.com/parent_category_3/parent_category_2/parent_category_1/category.html
;•
[filter_all]
- inserts all chosen filter attributes on the category page. For instance:[category][ – parameters: {filter_all}]
. If "color", "occasion", and "shoe size" attributes are chosen, on the frontend you will see:"Shoes – parameters: Color Red, Occasion Casual, Shoe Size 6.5"
. If no attributes are chosen, you will see: "Shoes".•
[filter_attribute_code]
inserts attribute value if exists. For instance:[category] in [filter_color]
will translate to"Shoes in Red"
on the frontend.•
[filter_attribute_code_label]
- inserts mentioned product attribute label on the frontend. For instance:[category] filtered by [filter_color_label]
will be parsed as"Shoes filtered by color"
on the frontend.•
[filter_attribute_code_value]
- inserts mentioned product attribute value on the frontend. For instance:[filter_color_value] [category]
will be parsed as"Red Shoes"
.
From here, the store owner can choose the values whether to apply the template to All categories or to the ones with the Empty values.
The Apply By Cron setting schedules its auto-apply using Mageto Cron. To configure Cron in Magento 2 you can check this guide.
After a template is created, click the Save button.
Select the created template and hit the Test Apply button in the dropdown. Thus, you will test the template before it gets applied.
To apply the template, click the Apply button.
Use Cases
Click here to see the practical Use Cases of this functionality.
Category Filter Templates¶
With SEO Meta Templates, the store owner can turn pages filtered by Layered Navigation into regular store pages with SEO value.
Note: this functionality is available for the users that have the SEO Suite Ultimate extension.
To view, edit and add the category filter templates, go to MARKETING ⟶ MageWorx SEO Templates ⟶ Category Templates.
Please note that during the initial setup this grid will be empty.
The columns can be sorted alphabetically by clicking the column title.
The grid supports mass actions. For this, click the checkboxes near the templates that you wish to modify and click the Edit link on the Actions dropdown. When the edits are done, click the Save Edits button to proceed.
To create a new category filter template, click the Add New Category Filter Template button.
The Reference provides the possibility to automatically optimize category description (will appear in the frontend) and category meta data.
Then, it is possible to select the desired filter (Attribute) that will work as the condition for the template to be applied. On the frontend, once the user selects this filter (Material filter on the screenshot), the template will be applied and shown.
Also, from here, the store owner can choose the Store View this template will be applied to.
Hit the Continue button.
Check the name of the template as it provides the quick information regarding the conditions selected on the previous step.
Depending on the value of the Assign Type setting, the configuration of the category filter template may have the second tab or not.
In case the All Categories is selected, the tab is hidden.
If the store owner wishes to specify the categories and select the Specific Categories value, the Categories tab appears.
The store owner can type the desired categories in the categories field and then select one of the suggested options.
The templates settings are the same regardless of the Assign Type value.
You can select the desired Attribute Value for the corresponding attribute.
The Name settings is the merely informative meaning as it is shown only on the templates grid.
The Template Rule is the main mechanism to specify the desired template pattern.
-
The Category Filter Meta Keywords support these attributes:
•
[category]
- outputs a current category name;•
[categories]
- outputs a current categories chain starting from the first parent category and ending a current category likeElectronics - Cell Phones
;•
[website_name]
- outputs a current website name;•
[store_name]
- outputs a current store name;•
[store_view_name]
- outputs a current store view name;Randomizer feature is available. The construction like
[Buy||Order||Purchase]
will use a randomly picked word for each next item when applying a template. Number of randomizer blocks is not limited within the template. -
The Category Filter Description, Category Filter Meta Tile and Category Filter Meta Description support the above-mentioned variables and variables like:
•
[parent_category]
- outputs a parent category name;•
[parent_category_1]
- outputs the first parent category name. It equals to [parent_category]. [parent_category_2] - outputs the second parent category name, etc. The orders of the parent categories is as follows:www.site.com/parent_category_3/parent_category_2/parent_category_1/category.html
;•
[filter_all]
- inserts all chosen filter attributes on the category page. For instance:[category][ – parameters: {filter_all}]
. If "color", "occasion", and "shoe size" attributes are chosen, on the frontend you will see:"Shoes – parameters: Color Red, Occasion Casual, Shoe Size 6.5"
. If no attributes are chosen, you will see: "Shoes".•
[filter_attribute_code]
inserts attribute value if exists. For instance:[category] in [filter_color]
will translate to"Shoes in Red"
on the frontend.•
[filter_attribute_code_label]
- inserts mentioned product attribute label on the frontend. For instance:[category] filtered by [filter_color_label]
will be parsed as"Shoes filtered by color"
on the frontend.•
[filter_attribute_code_value]
- inserts mentioned product attribute value on the frontend. For instance:[filter_color_value] [category]
will be parsed as"Red Shoes"
.
From here, the store owner can choose the values whether to apply the template to All category filters or to the ones with the Empty values.
The Apply By Cron setting schedules its auto-apply using Mageto Cron. To configure Cron in Magento 2 you can check this guide.
After a template is created, click the Save button.
Select the created template and hit the Test Apply button in the dropdown. Thus, you will test the template before it gets applied.
To apply the template, click the Apply button.
Please note that it’s generally advised to create 1 type of category filter template (e.g. a template for Category Meta Title) for one layered navigation attribute filter at a time. If you have a page with multiple filter attributes, like /color/size/shape.html, you should create a appropriate type of the SEO meta template only for the main attribute.
The store owner may specify the priority for different layered navigation attributes for the same template type. Thus, if the same template type gets associated with a number of different attributes, the extension will pick up the one that has the biggest priority.
To set the attribute priority, first, the store owner should disable the enabled by default Use SEO-ed data for a single filter option in the SEO Extended settings.
The priority is based on the position of the product attribute. To check the position of the product attribute, go to STORES ⟶ Attributes ⟶ Product, select the desired attribute and click the Storefront Properties tab. The lower the number here, the higher the priority.
Use Cases
Click here to see the practical Use Cases of this functionality.
Backend Setup¶
Log into the Magento Admin panel and go to STORES ⟶ Configuration ⟶ MAGEWORX ⟶ SEO, then select SEO Extended Templates tab.
Use Product SEO Name for Product Pages and Use Category SEO Name for Category Pages are the settings that allow to use the SEO name of the categories and products instead of the real name. SEO Meta Templates uses the SEO name for both categories and products. They can be populated individually as well.
For the products settings, go to PRODUCTS ⟶ Inventory ⟶ Catalog, select the desired Product and open the Search Engine Optimization tab.
For the categories settings, go to PRODUCTS ⟶ Inventory ⟶ Categories, select the desired Category and open the Search Engine Optimization tab.
Crop Root Category from Category Template Variable [categories] setting eliminates the possible problem with the [categories]
variable. It provides the full path to the product and occasionally include the technical category (Root Category) as the first one.
Crop Meta Title and Crop Meta Description if enabled, provide the possibility to limit the lengths of the titles and descriptions. This meta data is shown on the search engine results page.
Enable E-mail Error Notification setting allows to send the reports regarding the problems with the templates to the store owner. If enabled, the Error Email Recipient configuration appears with the possibility to add the store owner's email address.
Generating the Templates Via Console¶
It is possible to generate the templates via console. Currently, both category templates and product templates can be executed.
For this, via SSH, navigate to the root Magento folder and perform the command:
c
php bin/magento xtemplate:category:apply {id}
or
c
php bin/magento xtemplate:product:apply {id}
Here the {id} variable is the ID of the product or category templates. It can be found on the product and category template grid. Alternatively, to obtain the sitemap's ID it is possible to execute the commands without the {id} variable like:
c
php bin/magento xtemplate:category:apply
or
c
php bin/magento xtemplate:product:apply
The list of the corresponding product/category templates will be shown with their appropriate IDs.
Glossary¶
Meta Information
Metadata can help the crawler understand what the content on the page is about and give visitors valuable insight into it. Meta elements are a part of the webpage's <head>
section. Multiple Meta elements with different attributes can be used on the same page. Meta elements can be used to specify page title or description, they are visible in the search engine results.
Meta Title
Meta title is the main element of any given webpage. The search engines display them prominently on the search engine results pages. Actually, meta title is the main way the users can find out the name of the page they've found on the results page. So, actually, besides being a quite important parameter for Web crawlers, the store owner can also use it to influence users. The title tags should be no longer than 70 characters (with spaces).
Meta Description
Meta descriptions provide some information about the content on the webpage in greater detail. The content of the meta description is not a ranking factor. But it is vital to encourage users to click on the website URL. The meta description tags should be no longer than 280-320 characters with spaces. If no description is set up, the search engine will automatically pull any snippet of text from the Web page instead, which may lead to misunderstanding with searchers and worsen the page click through rate (CTR) index.
Meta Keywords
Meta keywords are a type of tag contained within the HTML of a webpage or document. The content of the meta keywords is not a ranking factor since 2009, however this field can still be populated.
The Difference between the Short and Standard Description
While the standard Description field takes place in the tab, it is possibee to provide the Short Description. The Short description is placed below the Add to Cart button.
Got Questions?¶
MageWorx offers FREE lifetime support and updates for any extension developed for Magento. Need help with the extensions? Feel free submit a ticket from https://www.mageworx.com/support/
MageWorx offers outstanding services developing custom-tailored solutions for Magento platform to attain your eCommerce objectives. Our professional impassioned team provides profound and custom oriented development of your project in a short timeframe.