Search engine optimization is one of the key factors for any online store. While off-page SEO, that is citations and links pointing to your site, is important, you should never forget about on-page optimization. The latter is within your full control and can be implemented properly.
In this post, I will try to cover all Magento 2 SEO settings and tips that are available there out of the box.
Article summary
Main Magento 2 SEO aspects
The importance of meta tags cannot be overestimated. Your site needs them to rank high and look attractive in SERPs. Product pages are most important for e-commerce sites, so I’ve decided to start with them.
There is one new Magento 2 SEO optimization feature that you will like: Fields Auto-Generation. It helps to set templates for product metadata. They are applied on a global level.
The setting can be found under Stores > Configuration > Catalog > Catalog > Product Fields Auto-Generation
This is a great tool which will save you lots of time, especially if you have many products. However, there are some drawbacks I must point out:
- As auto-generated fields are set up globally, you can’t change them for products found in particular categories, say, for men and women clothes.
- Currently only 3 placeholders are supported: {{name}}, {{description}} and {{sku}}. This doesn’t provide much pliability.
- Adjustments you can make in these global settings are not retrospective, i.e. they won’t be applied to the existing products. It’s not convenient if you’ve found a misspelling or just want to change something quickly.
- The {{description}} placeholder may not be the best choice for Meta Description Mask if the product descriptions are long which is probably true for most stores (and it’s OK as they are the main content on such URLs). So if you use {{description}}, you will probably get something like this:
To sum it up, while a new Product Fields Auto-Generation feature is a great perspective, it is quite basic and limited right now.
Alternatively, you can edit titles and Magento 2 meta descriptions right from the product page settings: Product > Basic Settings > Search Engine Optimization. They will overwrite meta data set globally via Product Fields Auto-Generation. This way you can customize product titles and meta descriptions, but it will be extremely time-consuming if you have many products as you will have to make changes on a one-by-one basis.
To overcome these limitations and extend the default possibilities, we developed the Meta Tags Templates extension, as well as Magento 2 Meta Title extension. With its help, you can not only create templates for meta title, meta description, and keywords but also set up H1, description, image alt for categories, subcategories, and products.
SEO-friendly URLs for products
>A product URL in Magento 2 is created in accordance with the SKU you’ve specified. But you can change or edit the URL if you need it. This feature is located in Product > Basic Settings > Search Engine Optimization.
But if you want to generate product URLs automatically, you can use the Unique Product URL extension. Once you have set up this extension , it will work automatically without any attention required.
Metadata for categories can be set up on a store view level in Stores > Configuration > General > Design > HTML Head. This can be overwritten on a category level at Products > Categories > General Information. Here you can also choose a URL for the category according to your needs.
Another way, how you can make URLs more SEO friendly is by enabling URL rewrites. This tool optimizes URLs by deleting unnecessary words like index.php. that have a low impact on performance or site rank.
See how to enable Web Server Rewrites.
Magento 2 will continue the tradition of Magento 1 and set the default main page title to – guess what? – Home Page, right. So one of the first things you should do when you switch to Magento 2 is to customize this important tag in Content > Pages > Home Page > Page Information
Meta description and meta keywords can be changed on the Meta Data tab.
If you need to add your company name or anything else either at the end or at the beginning of your title tags across all site pages, you can do it in Stores > Configuration > General > Design > HTML Head
Images optimization
Images optimization plays a vital role in site speed. The latter affects your site rankings: the faster your site is the more ranking ability it has. Unfortunately, Magento 2 doesn’t have out-of-box tools for image compression.
In Magento 2 you can add alt attributes for product images in Product > Basic Settings > Images and Videos > Alt Text.
And please change the alt text for your logo image from “Magento Commerce” to something related to your brand in Stores > Configuration > General > Design > HTML Head > Header :
Unique Content
I have already pointed out many duplicate content issues that can be found on most e-commerce sites. The good news is that Magento 2 has some out-of-the-box tools to solve many of these SEO problems.
Canonical Tags
Canonical tag, also known as canonical URL, is an URL that you mark as a preferred search engine. Thus, Google bots know which pages they need to crawl firstly. If you don’t use canonical tags, Google will choose them yourself.
Learn all the details about canonical URLs
To enable canonical tags for categories in Stores > Configuration > Catalog > Search Engine Optimization (1)
This setting guarantees that canonicals are also applied to sorted and filtered pages, i.e. the ones with product_list_mode=list, product_list_order=name, etc. This minimizes the chances of thin content occurrences on your site.
However, there are a few things to remember:
- Instead of canonicalization, pages with sorted or filtered results can be noindexed either by setting up exclusions in Google Console or by adding meta robots META NAME=”ROBOTS” CONTENT=”NOINDEX, FOLLOW” to such URLs. But the latter is quite problematic since there is no default option for this in Magento 2, I’ll write about it in detail below. Mind that either canonicals or noindex tags should be used, not both entities simultaneously.
- If you want to utilize pages with applied filters and/or sorting options for SEO by creating landing pages, you can achieve this only with a special extension like Improved Layered Navigation for Magento 2 .
- If you choose to set “Yes” for Canonical Link Meta Tag for Categories, canonical tags will be applied to paginated results too. While using them for such URLs is OK, adding Prev-Next tags is preferable.
Category path in product URLs
If you navigate to Stores > Configuration > Catalog > Search Engine Optimization, you’ll find an option to choose whether to enable or disable showing category paths in product URLs (see the image above, 3). These category indicators are good for indexing and clearly show the logic of store navigation. There are a few scenarios of using this setting in combination with canonical tags:
- You can choose not to add a category path to a product URL. In this case, there won’t be any threats of potential duplicates.
- If you add category paths to product pages addresses and don’t enable canonicals, you might face duplicate content issues.
- If both category paths and product canonicals are enabled, each product page will have a canonical pointing to itself without any category indication. Concurrently, each product URL will have a category path in its address and be accessible from all the categories you’ve added it to.
Control of site indexing
Robots.txt
One of the greatest improvements of Magento 2 in terms of SEO is the ability to edit your robots.txt file right from the Magento 2 admin panel: Stores > Configuration > Catalog > Design > Search Engine Robots:
This is quite handy, isn’t it? Your robots.txt file can be accessed at yoursite.com/robots.txt which is the right place for it.
Though a default configuration of robots.txt is ok, you would probably want these directories disallowed as well: /catalog/product_compare/, /catalogsearch/, /wishlist/
See the list of custom instructions for robots.txt
Meta robots
As you can see on the image above, default meta robots in Magento 2 are set to INDEX, FOLLOW which is correct if you want your site to be indexed by Google. However, you can’t customize it on a specific page. For example, if you create a duplicate product to set up an experiment in Google Analytics, you will have to find a way to restrict search engines access to this page. You could add such URLs to the robots.txt file but this doesn’t always work as expected.
XML Sitemap
Magento 2 provides many useful settings when it comes to generating an XML sitemap, you can find them in Stores > Configuration > Catalog > XML Sitemap:
The most important changes are the following:
- All the images can be added to the sitemap automatically;
- There is an option to submit the URL of your XML sitemap to robots.txt.
- You have the ability to set the number of pages per file as well as the maximum file size.
And now here is some bad news:
- There is no opportunity to choose which product types should be added to the XML sitemap: grouped, simple, configurable, etc. You may want to add only one type, for example, if you have configurable products that consist of two or more, say, software versions. Each version is a simple product and will be automatically included in the sitemap, while you need to include the configurable version only.
- An option to add images to the XML sitemap is certainly great, but what about other file types? If you want to include PDFs, Microsoft Word files, etc., you will have to add them manually.
- You can’t exclude or include particular pages if there is a need for that.
HTML Sitemap
Unfortunately, no HTML sitemap is available in Magento 2 out of the box, so you’ll need customization or extension to create one.
Additional changes
Suffix for Product and Category URLs
This new Magento 2 SEO feature helps to set up a suffix for your site pages: Stores > Configuration > Catalog > Catalog > Search Engine Optimization
In theory, you can use different suffixes for products and categories. But you will hardly benefit from that as users expect to see an identical URL structure within one site. Moreover, using different suffixes may lead to numerous 404 pages: changes you make in these fields are retrospective but no redirects are created automatically. So if you used to have a product at yourstore.com/category/product.html and changed the product pages suffix to .ht, your former page will return a 404 error, so be careful with such significant changes.
Microdata, or rich snippets in Magento 2
This is a great innovation of Magento 2 and I’m sure merchants will be happy with it. All product pages have microdata added to them by default. There are no settings available: they are not necessary as almost all important tags are included:
You may ask why I wrote “almost” above. Well, there is a reason for that: while Magento 2 default microdata will help to get rich snippets in Google SERPs, it is still rather basic. For example, it’s missing “Availability”. You can compare the results from a page which uses Google Rich Snippets for Magento 2 extension :
As you can see, much more info is provided to Google in this case.
Additionally, only product snippets are available in a default Magento 2 configuration; if you want to add breadcrumbs, organization or search box markup, you will have to do it yourself or with the help of an extension, for example, the one I’ve mentioned above.
Google Analytics and Magento 2
Magento 2 offers a handy tool for adding a Google Analytics tracking code to your store: Stores > Configuration > Sales > Google API > Google Analytics
All you need to do is to enable Google Analytics and add your Tracking ID which can be found under Admin > Tracking Info in your GA Account.
See the detailed magento seo guide on how to add GA to M2
Another great point is the ability to enable content experiments. If you do that, you will be able to add a Google Analytics Experiment code to a product page section: Product > Advanced Settings > Product View Optimization:
However, you will still need to create a duplicate product page and add a noindex tag to it. Generally, other aspects of setting up split tests in Magento didn’t change.
Google AdWords and Magento 2
Magento 2 developers decided to do their best and made Google AdWords implementation much easier for merchants. By navigating to Stores > Configuration > Sales > Google API > Google AdWords, you will see all the needed settings:
Conversion ID, Format, Color, etc. can be found in your Google AdWords account.
Voice search
Nowadays, voice search is gaining popularity among users. They want to use voice not only with Google requests but also on your website. To make your website more friendly for the voice search, you need to do the following steps:
- optimize your website for mobile devices;
- reach zero blocks;
- build a strong semantic strategy;
- improve site loading speed;
- restructure your website.
If you are not sure, just remember that around 110 million people use voice searches every day, and the total amount of money they spent on shopping may reach $40 billion in 2022.
Check the full voice optimization plan
It may not be obvious, but you can improve SEO by changing settings of the Improved Layered Navigation extension. Too long URLs, filtering results crawling, similar content, all these problems can be managed by right settings combinations. Follow the guide to learn how to:
- block everything from indexing;
- add brand pages to indexing;
- make filtered results more appealing.
If you are using the Magento 1 extension, you can use similar ideas and check this guide for detailed instructions. And if you have problems with the URL generation tool, check the settings like in this article .
Useful links
The list of common SEO mistakes
Final thoughts
As you can see, a lot of things have been done to improve SEO and overall online marketing possibilities of Magento 2. However, while these new settings are useful, most of them are too basic and offer minimum to no flexibility when it comes to real stores and products.
Thus, we offer you our all-in-one SEO Toolkit that includes 6 SEO extension:
- Cross Linking M2
- Google Rich Snippets M2
- HTML Sitemap M2
- Meta Tags Templates M2
- Unique Product URL M2
- XML Google Sitemap M2
And altogether, they can automate your Magento 2 SEO process, reduce manual work, and improve your store ranking.
Check the user guide to learn the full list of features
I do hope the article was helpful for you! Wish you good luck with your Magento 2 SEO strategy. If you still have any questions, please do ask them in the comments!
Do you know if Magento 2 is supporting Google Analytics Enhanced ecommerce tracking?
If not, do you have any plans on developing this as a module?
Hello Martin,
Currently there are no default settings for GA Enhanced eCommerce tracking in Magento 2. We are considering creating a special extension for that, but these are long-term plans.
Hi Kristina, Okay thanks for the answer. I hope someone is looking into this, and I wondering why Magento didnt do it themselves.
Keep up all the good work you guys do
I need easy bulk update extension for Magento 2
Hey Masuk,
I’m not sure what you mean here. Maybe it’s Mass Product Actions?
Simply Magento 2 is SEO friendly and it provides all the best features as compared to another e-commerce platform. This is really an amazing article with full details. Thanks for sharing it with us.
Thanks for reading 😉
Magento 2 is better option compared to other e-commerce platform.
Thanks for the great post.
Hi Kristina-as a novice to seo, how will I know if my developer did all that needs to be done for seo during development of new magento 2.x site?
Hey Mir,
thanks for your question.
Looks like you need to go through the points manually, because there is no tool which will automatically check everything you need. Good luck!
This is a great article Kristina, really appreciate your effort of creating such a wonderful content for the community!
Is it worth hiring someone with experience to carry out the link exchanges, or do you do it ourselves?
Added to Reddit, someone will like it
Come visit my site, I tried working in some kind of search engine optimisation but it didn’t work though
Added this on my wall, very interesting
This is some awesome Magento 2 goodness:)
Those shortcuts in the infographic are perfect for marketers and store administrators, who usually don’t fiddle with the settings. Great stuff. Thank you for sharing.
On a side note, Magento did step up their SEO game recently and posts like these really highlight the opoortunities.
Thanks for your feedback, Alex!
Since Magento 2.1.x the HTML Head section has been moved under Content/Configuration, not Stores/Configuration.
Hey Tom, thanks for pointing out, you’re absolutely right. We will correct the infographic.
This post is worse to read and save as a note. When I just started to work on Magento 2 I have saved a lot of time with this guide. Otherwise, I’d have to googling for a couple of hours.
Thank you, Anjey, for your positive feedback:D
thank you for one more useful article, guys. i have removed the index.php from all the url’s as they were causing some issues, but i noticed that the sitemap.xml’s output is still includs the index.php url’s for the sitemap. do you have any idea how to omit the “index.php” from the sitemap’s url?
Hi, Ray, thanks for the question. It’s hard to say what it is exactly as it could be a number of things. Are you sure that a new sitemap has been generated since you removed the index.php part from the URLs?
Hi Kristina,
Thank you for you blog.
Can you help me by the following issue;
we can’t get the meta tile and description live on the homepage of the site;
eu.caltikbros.com and caltikbros.com
Hi,
Have you checked this section Content -> Pages -> Home Page -> Page Information? If you’ve created the meta data there, don’t forget to clear the cache.
Additionally, you might be using some meta data plugin that is blocking your changes.
There are many variants why you can’t get the meta data, and it is hard to discover the real problem just looking at the frontend.
> Each version is a simple product and will be automatically included into the sitemap
Not always true. Child items are not added to sitemap if their Visibile = “Not Visible Individually”.
> Mind that either canonicals or noindex tags should be used, not both entities simultaneously.
Really? Any proofs? I’ve never heard about that… 🙁
Thanks for your comments.
> Child items are not added to sitemap if their Visibile = “Not Visible Individually”.
This makes sense. Why would you need to list a page in your sitemap if this page cannot be accessed by URL and thus will not be indexed anyway?
> Really? Any proofs? I’ve never heard about that…
Yes, you can read this https://www.seroundtable.com/noindex-canonical-google-18274.html
And if you look at this point more closely, you should understand that by adding ‘noindex’ to a page you ask Google not to index it, and it won’t in most cases. So Google won’t see your canonical tags. Additionally, you’ll waste authority (if there is one) of a noindexed page.
You say microdata is added to snippets by default. Why then snippets are not displayed in search results for my site?
Hi Ann, thanks for your question! You need to know that rich snippets display is not guaranteed by Google. It may view your site or markup unreliable and inconsistent. Or simply, marked up content hasn’t been discovered yet and rich snippets haven’t appeared in results. Besides, you need to know that in Magento 2 default setting only product snippets are available. Thus, if you want to add breadcrumbs, organization or search box markup, you will have to do it yourself or with the help of an extension. For instance, you may use Google Rich Snippets.
Do you happen to know how to add pdfs to my xml sitemap?
Hello Casey, thanks for your question! If you want to include PDFs, Microsoft Word files, or some else formats to your XML sitemap, you will have to add them manually, because they are not supported by Magento 2 native settings, despite images for XML sitemap.
What exts recommend me to use for html sitemap?
Hi McMurty, thanks for your question! For this needs you can apply our HTML Sitemap extension.
Hi Amasty, thnx for the highly useful post! Though some pathes differ from my 2.1.9, all info is relevant.
Hi there, thanks for your feedback! We are glad to share our experience and be helpful.
Ok, but wait…can’t I add new microdata for rich snippets without any add-ons?
Hi Ladd, thanks for your question! You see, all the settings that go right out of the box in Magento 2 are described in the post , which means that any additional microdata can be added only using a special extension. You can try our Google Rich Snippets. It will allow you adding product images, short description, stock availability and other useful data.
Hi Kristina, Its very nice that you give the Magento seo tips! Thanks.
Hi Tamika, thanks for the great feedback! We are glad to be helpful to our readers.
I used google optimizer for experiments with pages for m1. Now I switched to m2 and know I can make it via the backend.
But should I close one of the duplicate pages from indexing or it will be closed automatically?
Hi there, thanks for your question! That’s true, Magento 2 offers Product View Optimization for content experiments. However, you still need to create a duplicate product page and add a noindex tag to it.
Can I customize product groups for meta tags auto-generation fields?
Hello Bruce, thanks for your question! Yes, sure, you can create custom meta tags for products but only manually. It may be pretty time-consuming, but definitely good for SERPs needs.
hi, I had different suffixes for products and categories. Then I led them to a general view and added .html to all of them in seo settings. Now I see too many pages are redirected to 404. What can I do with that?
Hello Brandon, thanks for your question! So if you changed the pages suffixes, your former pages will return a 404 error. You can rollback the changes or review the pages manually via the admin panel to return the previous suffexes or redirect the pages.
I enabled google analytics in m2 but have no idea if it already works or not. How can I get it?
Hi Leo, thanks for reading us and for the question! The most vivid and simple way to check it is to switch to Real-Time Analytics in your GA. See here to learn more abou it.
It’s a great article. I have recently developed my eCommerce website and very happy with Magneto. And the article really helped me
Hi there, thanks for reading and your kind words!
Hello , i have magento 2 seo suite , but robots.txt is displaying path to default magento sitemap /robots.txt not the path to amasty sitemap /pub/media/google_sitemap_1.xml , how can i fix that ?
Hi there, I’ve passed your questions to our dev. team to check this case locally.
To help you out faster, you can write the path manually or address our support@amasty.com with a ticket, they’ll be happy to solve this. Also, please check your module version. If it’s not the latest, update it. Thanks for choosing our products!
Hi Kristina,
I have found this article very informative and interesting. Every aspect of this article is very helpful. You took your time to arrange it and it is also simple to understand with the help of images as well.
Thank you so much.
Hi Matt, thanks for sharing your feedback!
Thanks for all this information! But could you help me with the SEO bottom title and SEO bottom line found on the categorie pages? What does it mean and in which way it helps you for your SEO?
Tahnks in advance!
Hello, Amelie.
Could you please give a little bit more details about what exactly you are interested in category pages optimization?
Thank you in advance!
Using Amasty SEO plugin for Magento2, love it! One practical issue I run into though. We alter the original category URL’s to SEO friendly slugs. They get indexed by Google perfectly (so far so good). However when I look at them in Google Analytics (to check for most populair landing pages for instance) then only the original – ID version – url’s are shown in Google Analytics, so this is very unconveniant. Is there any way to make the SEO friendly url’s slug’s the url’s shown Google Analytics as well?
Hi Bram, thanks for using our extension and for the question. Pity you’ve come up with the issue. You see it’s difficult to answer from here. But you can contact our support team to view the problem in detail. We’ll see what we can do with it. Thanks in advance!