[Update 2024] Magento 2 SEO Guide – The All-in-One Definitive Guide

by Van Nguyen

In the e-commerce world, getting to the top of the search engine ranking plays an important part in sales conversion. Search engine optimization, thus, has always been a tough challenge for any online store.

In this article, we will provide a Magento 2 SEO Guide with all default features that you can configure SEO in Magento 2 admin panel and help you overcome the default limitation along with more advanced functions.

I. What is SEO? 

As you know, SEO stands for Search Engine Optimization – a technique to help websites increase traffic through organic search results. By doing good SEO, a website can be highly evaluated by search engines (Google, Bing,…) and get high rankings on Search Engine Result Pages (SERPs).


II. Is SEO important to store? 

SEO plays a very important role not only for stores but also for every website of any Ecommerce platform. SEO for Magento 2 helps to increase the quantity and quality of traffic, which brings potential customers interested in products or services of the Magento 2 store and generates revenues.

Also, making a website SEO-friendly with Magento 2 SEO tips and settings improves user experience and usability of the website, leading to a better shopping experience. 

>>> Do you know Hyva Theme is a solution to improve your SEO ranking of Magento? Curious about this theme? DOWNLOAD OUR FREE HANDBOOK NOW!

III. How does default Magento 2 support SEO? 

Till now, the default SEO Magento 2 settings support quite well the basic needs of on-page SEO. You can easily navigate to Marketing ⇒ SEO & Search to explore what functions default Magento 2 supports store owners. In addition, there are a lot of other SEO settings that need to spend more time discovering and configuring for your site.


However, as mentioned above, the default functions in SEO optimization are still limited.

Default Magento 2 SEO Guide

I. Metadata in SEO guide

Metadata is the foremost fundamental setting when it comes to how to do SEO on Magento. You can spot this information on the search result page and it affects how the search engine crawlers index your site. While setting up your store, you should consider using keyword-rich data for better SEO performance.

For product page metadata, you can go to Catalog ⇒ Product ⇒ Choose a product ⇒ Search Engine Optimization to start configuring this function of the Magento SEO marketing guide. 

1. Meta title

The Meta Title – a SEO feature appears as the title of your product page in the search result. Try to include the high-value keywords you want to aim for the page in this field to get better recognition from web crawlers. Choose wisely as you are limited to under 70 characters.


2. Meta keywords

Unlike the meta title, you have no maximum limitation for meta keywords. And they do not appear in the SERPs. Fill in all the keywords of the page for the crawlers to know what your product is about. However, don’t go over-filling and come up with the related ones only.

3. Meta description

The maximum allowed chars in default Magento 2 is 255. And you may see an instruction text to optimize between 150-160 chars. Wise optimization can raise more clicks through the search. Not just keywords include some phrases to attract more customers such as support policy or promotion.

4. Mass settings for product metadata

In case you have a large-scale site with thousands of items to manage, the below settings of the Magento SEO tutorial may be a great help. It sets a template for metadata of products at a global level.

Go to Stores ⇒ Configuration ⇒ Catalog ⇒ Catalog ⇒ Product Fields Auto-Generation

Here, you can make a sample for meta title, description, and keywords for all products in your Magento 2 store.


By default, Magento 2 takes placeholder such as {{name}}, {{description}} or {{sku}} for the meta information. 

When you are using this Product Fields Auto-Generation feature, the SEO suggestion for the character limit of metadata above is still applied. Thus, be careful if you have a too-long product description as the meta.

*NoteLimitations of Mass settings for product metadata in default Magento SEO optimization:

  • You can only use 3 placeholders as mentioned above to create a meta-template of products. Other placeholders such as  {{color}}, {{country_of_manufacture}}, , {{gender}}, {{material}}, {{short_description}}, and {{size}} haven’t yet supported.
  • It works only at the level of Global scope. Therefore, there are not any templates for websites, stores or store views or even categories to apply.
  • Mass settings does not support automatically changing meta tags for existing products, but the template is only applied to newly created products.
  • It does not apply to products that are imported, migrated or programmatically created.

5. Metadata for categories, CMS pages and homepage in SEO guide

For categories, you go to Catalog ⇒ Categories and create a new category. Navigate to Search Engine Optimization; you do similarly to adding metadata for products with meta title, meta description, and meta keywords.

For CMS pages, you can easily include their metadata by going to Content ⇒ Elements ⇒ Pages and select the Search Engine Optimization as well.

For Homepage, you also create a meta title by navigating Content ⇒ Page ⇒ Homepage ⇒ Page Information (similar to CMS pages) and customize your page title as you want. This page title plays an important role in ranking in Search engine search results and drawing customer attraction.


To sum up, you are given two choices to change metadata: a manual way for each product and an automatic way for all products at once based on a template you set up in advance. Each method contains particular advantages and disadvantages.

Therefore, it is better to take careful consideration before making your decision to choose which one is the most suitable way.

You can use SEO Module to auto-add meta description, meta title, meta keywords, and description for products and categories, overcoming the limitation of default SEO guide. 

Furthermore, you can take advantage of ChatGPT for Magento extension to auto generate SEO-friendly metadata for your product pages, category pages and CMS pages!

II. Unique Content with Canonical Tag in Magento 2 SEO guide

Having unique content is one of the key factors, like an effective Magento 2 SEO tip recommended in all page content. Search engine crawlers take it low when there are multiple URLs pointing to the same or similar content.

For an open-source e-commerce site like Magento 2, this is a common problem because of the high variation in URLs. Google doesn’t like it at all and considers duplicate content in this case. As a consequence, Google will underestimate your content due to no uniqueness, and you can drop out of product page rankings on Search Engine Result Pages (SERPs). 


For example: 




⇒ All of these 3 URLs point to the identical content (Force Login extension page).

To solve this, you should explicitly tell Google which URL is authoritative (canonical) for that page. If you do not do this explicitly, Google will choose for you or might consider them both of equal weight, which might lead to unwanted behavior.

That’s also the benefit of the canonical tag in the Magento SEO guide. The rel=canonical <link> tag can be added to the code for all duplicate pages, pointing to the canonical page.

In the backend, the admins find a solution to duplicate content issues under Stores ⇒ Configuration ⇒ Catalog ⇒ Catalog ⇒ Search Engine Optimization.

1. Categories Path for Product URLs Optimization

In Use Categories Path for Product URLs, this Magento SEO setting option decides whether category paths are included in product URLs. For example, a Chaz Hodie is under both the Eco-Friendly and Hoodies category. If you choose Yes in this option, there may be SEO friendly URL pointing to the same product they are:


Or http://yourstore.com/hoodies/chaz-hoodie.html

Hence, the suggested option for this is No. Then, there is only one URL http://yourstore.com/chaz-hoodie.html when a customer accesses the item from any category.


In case you want to set Yes for this config, you must enable canonical to avoid duplicate content issues.

2. Canonical Tag for Products and Categories

In Use Canonical Link Meta Tag For Categories, you can choose Yes to add the canonical tag for categories with product_list_mode=list, product_list_order=name, and other variations. This is extremely helpful when there are various URLs with the same content from the filter and sorting options. A rel=canonical tag will be automatically placed.

The same goes for Use Canonical Link Meta Tag For Products. If you enable this option, search engines will index product pages only using the domain-name/product-URL-key format.

*Note: There is no configuration to enable canonical tags for CMS pages in the default Magento 2 SEO Guide.

III. URLs Optimization in Magento 2 SEO guide

1. URL suffix

The suffix is a part of the URL after the URL key. It is the .html or .htm part. In search engine optimization, the suffix should be excluded from the URL for the following reasons. Firstly, this information offers no value to users or search engines. Moreover, it needlessly increases the length of your URL.


To do it in Magento 2 SEO guide, access Stores => Configuration => Catalog => Catalog  => Search Engine Optimization.

In Product URL Suffix and Category URL Suffix, you can set any suffix or remove them. When removing the .html from the URL, your old links, including the suffix, turns to a 404 error page. Thus, you may need some consulting from SEO experts on how to fix this.

2. URL rewrite and redirect

A  SEO friendly URL is one of the most important factors that are used to rank a website by search engines. According to Google, “A site’s URL structure should be as simple as possible. Consider organizing your content so that URLs are constructed logically and in a manner that is most intelligible to humans”.


Compared to a URL like www.example/men/product35574.com, this URL www.example/men/shoeA.com is much more friendly and readable to both search engines and users. Hence, URL Rewrites are used to create better URL keys by rewriting bad URLs and changing them into friendly ones for search engines’ bots and user experience.

URL Rewrite is a familiar technique widely used by a lot of websites. It lets you rewrite the complicated URLs generated by systems into a new one which is better for your ranking as well as customer experience.

New URL keys now can be shorter, cleaner and make more sense than the old ones.

The default settings in Magento SEO tutorial already has the product and category URL named based on the product and category names. However, the admins can also change this setting for better SEO at the backend by optimizing friendly URL.

2.1. Remove ‘index.php’ file 

In terms of default Magento 2 SEO features, URLs contain the file name index.php (www.abc.com/index.php/men), which is useless to both users and crawlers. To remove this, follow this instruction


Go to Stores ⇒ Configuration ⇒ General ⇒ Web ⇒ Search Engine Optimization. Set Use Web Server Rewrites to Yes and the index.php will be auto removed (www.abc.com/men).

Moreover, URL key rewriting can be used for a keyword-rich and search-friendly links. As changing the URL makes your previous URLs lead to a 404 error page, redirecting optimization is also required at the same time. Below is how to rewrite URLs and set up redirects for SEO.

2.2. Automatic redirects settings

Under Stores ⇒ Configuration ⇒ Catalog ⇒ Search Engine Optimization, you can find an option named Create Permanent Redirect for URLs if URL Key Changed. Here, select Yes to enable auto redirect when the URL is replaced.

2.3. Product URL redirect

In order to change the URL key for a specific product, access Product ⇒ Catalog then select the items you want to configure. In Search Engine Optimization section, update the URL Key as needed, using all lowercase characters and hyphens instead of spaces.

Make sure that the Create Permanent Redirect for old URL checkbox is selected. Tap Save and clear the cache to complete this process.

2.4. Category URL redirect

The same goes for category URL rewrite optimization. Under Product ⇒ Categories, find the category in the tree. In the Search Engine Optimization section, write the new URL Key, using all lowercase characters and hyphens instead of spaces.

Make sure that the Create Permanent Redirect for the old URL checkbox is selected. Tap Save and clear the cache.


*Note: This permanent redirect is not applied to CMS pages. If you want to change the URL key of a CMS page, you have to create 301 redirects at Marketing ⇒ SEO & Search ⇒ URL Rewrites.

Also, in case a product is deleted or disabled, a 301 redirect to the homepage is necessary to do. Otherwise, the product URL will redirect to a 404 page.

3. Create a URL rewrite

You go to Marketing ⇒ SEO & Search ⇒ URL Rewrites, and you can see a grid table of default URL Rewrites.

You click Add URL Rewrite button.

In Create URL Rewrite, you choose Product from the dropdown list.

You click a product and click Skip Category Selection button under the category tree to go to URL Rewrite Information.


In Store: you choose a Magento level that URL Rewrite is applied. If you have multiple store views, let’s select Store. Otherwise, the URL rewrite is created for store view level.

In Request Path: you enter the new path for the product. Please add suffix with the new path if it has.

*Note: The Request Path must be unique for the specified store. If there is already a redirect that uses the same Request Path, there is an error when saving the redirect. The previous redirect must be deleted before you can create a new one.

In Redirect Type: You can choose No, Permanent (301), and Temporary (302).

  • Permanent (301) means that product URL is rewritten permanently and search engines can retain page rank information for permanent rewrites.
  • Temporary (302) means that product URL is rewritten for a limited time and search engines don’t retain page rank information for temporary rewrites.

In Description: you can give some description of this URL Rewrite.

Then, you save the configuration for this SEO setting and see the URL Rewrite in the grid table.

IV. Site Indexing in Magento 2 SEO guide

Indexation from search engine crawlers has a critical effect on website. To support this procedure, XML sitemap and robots txt file were created. These files will be submitted to the search engines to read and decide how your store is indexed. Let’s take a look at which is needed to configure in Magento SEO marketing guide:

1. XML sitemap 

An XML sitemap in Magento 2 SEO Help is an XML file listing all URLs of a website that instructs crawlers of search engines (Google and Bing) to read the content on the website. Hence, that’s how search engines read and rank the content of your Magento 2 store on the search results.

By default settings in Magento SEO tutorial, the sitemap.xml file is saved in the root directory of your installation. The configuration gives you the ability to set the frequency of the updates, and the priority for each type of content.

You should update your sitemap as frequently as the content on your site changes, which might be daily, weekly, or monthly. 

Please navigate to Stores ⇒ Configuration ⇒ Catalog ⇒ XML Sitemap. 

1.1. Page type options

In general, It allows admins to set up the Frequency and Priority for Categories, Products, and CMS Pages.


Frequency: select an option to define how often the sitemap is updated. (Always, Hourly, Daily, Weekly, Monthly, Yearly and Never). 

Priority: enter a value between 0.0 and 1.0 to determine the priority of categories/ products/ CMS pages updates in sitemap about other content. 

Add Images into Sitemap field of the Product Options: let admins add product images into the XML sitemap: 

– No: Do not add images to the sitemap.

– Base Only: Only add a base image of products into the sitemap.

– All: Add all images of products into the sitemap.

1.2. General settings 

At Enabled: set Yes to make the XML sitemap be generated automatically.

Start Time: set the time up to the hour, minute, and second to update the XML sitemap.

Frequency: select Daily, Weekly, or Monthly.

In Error Email Recipient:  enter an email to receive a notification email of error happening during an update.

Error Email Sender: select a sender in the store contact as the sender of the error email.

Error Email Template: select an error email template. 

1.3. Sitemap file limits 

Following Sitemap protocol for a standard XML sitemap in terms of SEO, a sitemap should not be larger than 10MB and contains over 50 thousand links. In the default value of the XML sitemap, you can notice that these rules are also applied.

In both Maximum No of URLs Per-File and Maximum File Size, admins can set the value they want. However, the Sitemap protocol should be followed for the best indexing of the search engine crawlers.

You may wonder what will happen if my XML file crosses the limit. In that case, another XML file will be created and continue listing the rest of the links in your store. Thus, there may be multiple XML files in case your store contains a massive number of web pages.

1.4. Search engine submission 

In Enable Submission to Robots.txt: select Yes if you use a robots.txt file to give instructions to search engines crawling your site.

However, there are some things to remember: You cannot

  • add specific pages to the XML sitemap,
  • remove links from the sitemap,
  • and have choices to select which product types to be added to the sitemap

2. HTML sitemap 

Default Magento SEO Guide does not support HTML Sitemap at all. If you want to include it on your website, please explore Magento 2 Dynamic HTML Sitemap!

3. Configure robots.txt file

The robots file is an instruction to the crawler bots on how to index your site. This instruction resides in the root folder and is followed by the search engine. To set up, go to Stores ⇒ Configuration ⇒ General ⇒ Design ⇒ Search Engine Robots.

For newer Magento 2 versions, you can find this file by following this path: Content ⇒ Configuration ⇒ (choose a store view) ⇒ Search Engine Robots:


In Default Robots, admins can select among:

  • INDEX, FOLLOW: Instructs web crawlers to index the site and to check back later for changes.
  • NOINDEX, FOLLOW: Instructs web crawlers to avoid indexing the site but to check back later or changes.
  • INDEX, NOFOLLOW: Instructs web crawlers to index the site once, but do not check back later for changes.
  • NOINDEX, NOFOLLOW: Instructs web crawlers to avoid indexing the site and do not check back later for changes.

*Note: Default functions in SEO ecommerce Magento do not include setting up Robots for each specific page.

If you want to set a specific instruction, changes can be easily made at Edit Custom instruction of robots.txt file.

>>> Take a look: Latest Update 23+ Best Free Magento 2 SEO Extensions For ECommerce

V. Other features in SEO Guide

1. Image alt text 

Alt text plays an important role in helping search engines understand the content of images and give them a weight of rankings in SERPs. The reason is that search engines cannot know what your images tell about without alt text. Hence, adding Alt text for images on your website is a necessary SEO tip if you want to get higher rankings. 

In SEO for Magento, you can manually insert Alt text for every image on your site, from product images to the store logo. 

  • Alt text for the store logo

Please go to Content ⇒ Design ⇒ Configuration and find a store view you want to edit. 

In Header, enter Alt text in the Logo Image ALT section. 

  • Alt text for product images or other images on the content pages 

For product images, just navigate to each product edit page, then select Image and Video and click each image to enter the alt text.


For other images on the content pages, you can add the alt text when inserting images conveniently. 

2. Rich Snippets in SEO Magento

As you know, Rich Snippets help your website stand out in SERPs with additional information such as rating and review. However, this default in Magento 2 is still limited due to the lack of many other rich snippet features such as price, availability, and so on. 

3. Pagination optimization

As a part of  SEO settings, you also need to optimize pagination with a canonical for SEO-friendliness. For example, such URL as http://abc.com/products.html?p=2 is pointed to http://abc.com/products.html. It means that the URL points to its category.


4. Performance

As you know, site performance is one of the most important factors in evaluating rankings on SERPs. Magento 2 also supports some functions to make website speed faster, such as Varnish and Redis,  Javascript, CSS and HTML minify feature, Javascript and CSS merge feature, a built-in Full Page Cache module and so on.

Moreover, ever since the release of Google’s core web vitals, website speed metrics such as the largest content paints have become a direct factor affecting SEO ranking. Implementing PWA (Progressive Web App) to your Magento website is a good way to leverage the speed performance & improve the Google Core Web Vitals for your site. For those who do not know what a PWA is, PWA is an advanced web technology that can increase site speed dramatically while enhancing the top-notch user experience on both mobile and desktop.

5. Google Analytics 

Google Analytics is an analysis tool that provides you with user insights on how they find out and use your website. Using Google Analytics, you can know such information as views, revenue, customer behavior, and so on. Check out settings in the following Magento SEO guide:

Step 1: Sign up for Google Universal Analytics

You need to access the Google website and create an account for Google Universal Analytics.

Step 2: Configure on Magento backend 

Please navigate to Store ⇒ Configuration ⇒ Sales ⇒ Google API.  

  • Choose Yes in Enable. 
  • In Account Number: enter your own account number which you can get right after signing up the account. (Tracking ID).
  • In Enable Content Experiments:  Set Yes to do A/B testing and other performance tests on your content. 

6. Google Adwords 

To advertise products on Google Search Result Pages (SERPs) or on other pages in the Google Network Display, we need to use Google Adwords service to set up advertisement campaigns. 

Keep following with these configurations in Magento SEO guide:

Step 1: Create Google AdWords campaigns

Please navigate to Google AdWords and create an account.

To add a new campaign, read this instruction

To track conversions brought via Google AdWords, you need to set up conversion tracking of your campaigns: 

  • Click Tools ⇒ Tools and Analysis tab and select Conversions. You are redirected to All conversions page, then click on the Conversion tab and continue to click on the +Conversion button. 
  • Choose Website as the conversion source.
  • Enter a name for the conversion action you want to track.
  • Click Done 
  • Click Value. Then if applicable, assign a value to the conversion. For example:

+ If you make $5 on each sale, choose “Each time it happens”, and assign a value of $5.

+ If the value of each sale varies, leave the value blank.

  • Continue to tab Conversion window, finish necessary settings.

Finally, click the Save and Continue button. 

Step 2: Get your conversion tag 

Go to Install your tag section and determine how many conversions to count on Page load.

Add the Google Site Stats notification to the conversion page. The notification will appear in the lower corner with a link to Google’s security standards and cookie usage.

To manage your AdWord tags, you can select one of the following options: 

  • Choose Save instructions and tag to add the script to your store by yourself.
  • Choose Email instructions and tag to get other people to add the script to your store. 

Then, click Done. 

Step 3: Set up on Magento store 

Navigate to Store ⇒ Configuration and choose store view to set up if you want.


In Sales, select Google API and go to Google AdWords section: 

Set Yes for Enable field

Enter Conversion ID that you get from Google AdWords script.

For Google Site Stats notification, you need to make the following settings: 

In Conversion Language: select a language that is identified in your Google AdWords script.

In Conversion Format: enter a number which specifies Google Sites Stat notification on the conversion page.

  • 1- show a one-line notification along with a link of reference to read about Google Tracking. 
  • 2- show a two-line notification along with a link of reference to read about Google Tracking. 
  • 3- no customer notification. 

In Conversion Color: enter a color code for the Google Site Stats notification label.

For Conversion Label: Enter the encrypted text.

and in Conversion Value Type: 

  • If you choose Dynamic, a conversion has occurred based on the dynamic Order Amount value.
  • But if it is Constant, a conversion has occurred based on a specific value entered.

Finally, click the Save Config button.

Step 4: Track status config verification 

You can track the status in your Google AdWord dashboard: 

  • Unverified 
  • No recent conversions
  • Recording conversions

C. Magento 2 SEO Extensions

I. What is SEO extension?

As mentioned above, Magento 2 SEO Guide cannot cover all features and it would be better if you install SEO extension to equip enough necessary functions. 

SEO extension developed by BSS is an all-in-one SEO solution for every website. This Magento SEO extension includes all important features to make a website SEO-friendly such as: 

  • Advanced HTML and XML sitemap
  • Canonical tags and Hreflang tag to avoid duplicate content 
  • Meta tag and ALT tag template 
  • Rich snippets to make websites highlighted on SERPs
  • Advanced breadcrumbs 
  • 301 redirects and external links 
  • Smart SEO analysis, SEO report and SEO audit

II. What does SEO extension function for?

There are some default SEO in Magento 2 functions included in this SEO extension but a lot of advanced features are added to make them better and better. 

Sitemap, Tags & URLs
  • XML Sitemap: you can exclude category, product type or product ID, and CMS pages from Magento 2 XML sitemap by configuring in the module config or on the edit page. This Magento 2 SEO module also lets you add meta data for the XML sitemap, divide sitemap and provides a user-friendly interface of the sitemap. 
  • HTML Sitemap: you can create this an HTML sitemap including products, categories, CMS pages, and additional links easily. If you want to exclude specific links from the sitemap, you can exclude it in the Magento 2 SEO module config. You can create HTML sitemaps for each store view, customize a URL key and display the sitemap in the footer or header. 
magento 2 seo extension - html sitemap
  • Canonical Tag: allows you to set up canonical tags for products, category pages, and homepage easily using SEO plugin.
  • Hreflang Tag: Magento SEO marketing module adds the Hreflang tag for each store view and enables it for the homepage, product, category, and CMS page. 
  • Meta Tag Template: This Magento 2 SEO feature helps admins to create meta tag template for products and category page with a lot of variables to insert. 
magento 2 seo module - meta tag template
  • ALT Tag Template: creates an Alt tag template and name template for images. 
  • Rich Snippets: sets up a number of snippets for products on SERPs in addition to 3 default snippets. You can also show rich snippets for category, display breadcrumbs in SERPs, and include a site search box in SERPs with the SEO module. 
magento 2 seo tool - rich snippets
  • Advanced Breadcrumbs: SEO module supports 2 types of Breadcrumbs: Use Short URL Path and Use Long URL Path to show on website and determine breadcrumbs by category ID conveniently. 
  • 301 Redirects: optimizes user experience when they access deleted product pages. 
  • External Links: sets external links as No-follow links. 
Analysis & Audit
  • Smart SEO Analysis: A very advanced Magento 2 SEO settings lets you quickly check the current situation of each element in terms of SEO. Whether they meet SEO requirements or not? 
seo tool bar - magento 2 seo extension
  • SEO Report: this SEO module shows a bar to let you know the process of entering meta title and meta description text length. 
  • SEO Audit: shows notification of the SEO compliance (meta data, main keyword, description & outbound links).


D. Conclusion 

SEO for Magento 2 requires lots of settings as well as SEO knowledge. It takes time to gain a significant rise in the ranking, but the equal gain in sales makes it worth the effort. This Magento 2 SEO guide helps store owners to know a lot of SEO functions to set up for stores, but they are still not enough.

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.