Magento 2 SEO Guide: Tips, Tricks, and Best Practices
Why SEO is necessary
Search engine optimization is one of the critical aspects for any Magento store. While off the page SEO, i.e. citations and links, is necessary, one should not forget about on-page optimization. On-page optimization can be a blessing if you implement it correctly.
While developing Magento 2.x, certain flaws of Magento 1.x were considered and hence have been improved in Magento 2.x. To be precise, SEO settings have been greatly improved in Magento 2 which I will explain in detail below so you can be aware of all the settings for SEO that come out of the box in Magento 2.
So basically, I have divided the Search engine optimization of your Magento store into three basic aspects. Think of them as a little checklist for your SEO. You can categorize all SEO configurations into these three divisions and one by one you can check and optimize your store according to them.
Here, I’ve come up with almost every setting for Magento 2 SEO. Have a look at what I have covered under this blog.
Index:
Magento 2 SEO Settings
- What is Meta Tag and why you should care? -Metatags are snippets of information about your page. Basically, it will tell the person who is searching what your page contains. It’s not the actual information written on your page but something that’s written in the code. So, it’s not visible to user on the page, but when searching, Google will look for this snippet to know what your page is about.Metatags have been highly underestimated. For a higher rank of your store and for a neat look on the SERPs you need Metatags. I’m starting with how you can add metatags for products and categories.
- Meta Tags for Products – In Magento 2, they have added one new feature for meta tags: Fields Auto-Generation. Applied on a global level, it will help you create product meta data templates. This new setting can be found here: Stores –> Configuration –> Catalog –> Catalog –> Product Fields Auto-Generation
For a store with many products, this will serve as a great tool which saves a lot of time for store owners. But it also comes with a few limitations:- Auto-generated fields are global configurations so you cannot change them for category wise products.
- Only 3 place holders are available: {{name}}, {{description}} and {{sku}}
- Since most product descriptions are longer than 25-240 characters, the {{description}} place holder might not be the best choice for your meta tag description field.
- Auto-generated fields are global and not retrospective. So, if you want to change the details for the products or make some amendments, they will not be reflected on the existing products where the details were already added.
All in all, the new Product Fields Auto-Generation feature is good but it has many limitations as of now.
Apart from Products Fields Auto-Generation, you can also edit meta description and title from product page settings here: Catalog –> Products –> Select & Edit Product –> Search Engine Optimization. Also have a look at website audit checklist to make your website perform well.The settings from here will overwrite the global meta description added from Fields Auto-Generation. This method is effective but the hell of a time consuming if you have a lot of products, which is probably the case for most Magento stores.
- Meta Tags for Categories -Just as for Products, for categories as well you can set up the meta data locally at the category level.Location for Category level metadata setting: Catalog –> Categories –> Search Engine Optimization. Here you can add meta title, keywords and description as per your requirement.
- Meta Tags for Content pages -You can change the title tags for your content pages from Content –> Pages –> {{content page}} –> Search Engine Optimization
- Meta Tags for Products – In Magento 2, they have added one new feature for meta tags: Fields Auto-Generation. Applied on a global level, it will help you create product meta data templates. This new setting can be found here: Stores –> Configuration –> Catalog –> Catalog –> Product Fields Auto-Generation
- SEO based URLs
- SEO based URLs for Products – In Magento 2 a product URL will be generated automatically according to the product SKU you have specified. But if you need to change it for any reason, you can do it here: Catalog –> Products –> {{Product}} –> Search Engine Optimization –> URL Key. You can also fetch all product URLs in Magento 2 to see if check if they are SEO-friendly or not!
- SEO based URLs for Categories – Similarly, for categories, if you need to change the URL key, go to Catalog –> Categories –> {{Category}} –> Search Engine Optimization –> URL Key.
- Prefixes & Suffixes for title tags on the whole site -It’s a good practice to add your company or organization name in your store’s pages. It will help associate your company name to your store.To add this in the title tags across all pages you can set it here: Content –> Configuration –> Website –> HTML Head –> Page Title Prefix & Suffix
- Suffix for product and category URLs -Just as for title tags, you can add prefix and suffix to your product and category pages as well. The location for this setting is: Stores –> Configuration –> Catalog –> Catalog –> Search Engine OptimizationAccording to the configuration options, it’s possible to keep different suffixes for product and category pages but for a general familiarity and uniformity of the site, it’s not advised.
- Image Optimization -One of the significant aspects of better site ranking is the site loading speed. Here’s when optimizing images in Magento 2 comes in the picture! Images take up a lot of space and so more images mean slower site loading time. Hence it is of utmost importance to manage your store images by optimizing them for better site performance.Magento 1.x didn’t provide image optimization and the bad news is neither does Magento 2.x. But in Magento 2.x you can add alt attribute for images which will help better optimize the product images.The settings can be done here: Catalog –> Products –> {{product}} –> Images and Videos –> Alt Text.Also, remember to change the Alt text for your store’s logo. By default, it is “Magento Commerce”, which is not helpful at all.Change it to something that is more in accordance with your store’s image. The settings can be done here: Stores –> Configuration –> General –> Design –> HTML Head –> HeaderApart from optimization using Magento 2 SEO Settings, it’s a best practise to use https://tinypng.com/ to compress images before uploading them. You can also remove unused product images in Magento 2 for improved performance.
- Rich Snippets or Micro data -This is one of the best features added to Magento 2 SEO settings. By default, the microdata is added to all the product pages. It’s a good start but still a long way to go. You don’t need additional settings as they are not required.To sum it up, it’s a good feature but it can be improved. For example, if you want to add a search tool, organization or breadcrumbs you will need to add it yourself or with the help of any extension. They will not be added automatically under rich snippets. You can generate organization or breadcrumbs schema manually with free tools.
- Google Analytics -You can add Google Analytics very easily to your store from: Stores –> Configuration –> Sales –> Google API –> Google Analytics
To enable Google Analytics on your store, you first need to have a Google Analytics account. You can use that account details in your store. You can find your tracking id under Admin –> Tracking Info in your Google Analytics Account. Which you can then use on the settings shown above.Another good point is the feature to create multiple pages for the content experiment. You can add a Google Analytics Experiment Code to any of your store product page from here: Product –> Advanced Settings –> Product View Optimization. Moreover, you can also use our Magento 2 Google Analytics 4 Using GTM extension to connect your store with the latest version of Google Analytics. - Google AdWords -In Magento 2, implementing Google AdWords has become very easy. You can find the configuration here: Stores –> Configuration –> Sales –> Google API –> Google AdWords
Details about all the fields mentioned above can be easily found in your Google AdWords account. - Create Unique Content -This is by far the simplest and most important factor while considering SEO for your store. Any e-commerce site or any website for that matter; needs to have unique content. Duplicate content may raise a lot of problems. It’s one of the reasons Google bans sites from search results.The good news for you is Magento 2 now provides settings for solving duplicate content issues and display unique content online.
- Canonical Tags for Categories – The rel=canonical element, often called the “canonical link”, is an HTML element that helps webmasters prevent duplicate content issues. It does this by specifying the “canonical URL” is the “preferred” version of a web page. Using it well improves your site’s SEO.You can enable canonical tags for categories in Stores –> Configuration –> Catalog –> Search Engine Optimization
- Canonical Tags for Products – You can enable canonical tags for products under Stores –> Configuration –> Catalog –> Search Engine Optimization.
- Category Path in Product URLs – If you navigate to Stores –> Configuration –> Catalog –> Search Engine Optimization, you’ll see the option where you can choose whether to enable or disable showing category paths in product URLs. These category indicators are great for indexing and show the logic of better store navigation. You can use this setting in combination with canonical tags for better optimization.
- Proper Site Indexing
-
- robots.txt – In Magento 2, you can edit your robots.txt file from your admin panel itself which is very helpful and quick way for admins to manage robots.txt. But to create one, you may use this free tool – robots.txt generator. This is one of the best things the developers did while adding SEO features in Magento 2. You can find the settings at: Content –> Configuration –> Search Engine Robots.
It’s quite neat and dandy. The most logical place for your site’s robots.txt file is at mysite.com/robots.txt and that’s where you can access the file on your site.Though a default configuration of robots.txt is ok, you will need to disallow these directories:/catalogsearch/,/catalog/product_compare/,/wishlist/ - Meta Robots – As can be seen in the image above, by default, meta robots in Magento 2 are set to INDEX, FOLLOW which would be okay for Google to index your site. But, you can’t customize it on a specific page. E.g., if you create a duplicate product to set up an experiment in Google Analytics to test your site, you will have to find a way to stop search engines accessing this page. You could add such URLs to the robots.txt file but the result is not always as you would expect from it.
- XML Sitemap – Many useful settings related to generating an XML sitemap can be found out-of-the-box in Magento 2 at: Stores –> Configuration –> Catalog –> XML Sitemap
The most critical changes are as follows:- All the images on your site are added to the sitemap automatically;
- You get an option to submit the URL of your XML sitemap to your robots.txt.
- You have the flexibility to set the number of pages per XML file as well as the maximum file size of your sitemap file.
And now to point out some limitations:
- You cannot choose which product type should be added to the XML sitemap. For example, if you have a configurable product with two simple products. Each simple product will be automatically added to the XML site map but if you want to add the final configurable product version only, it is not possible as of now.
- Images are added automatically and that’s great but other file types .pdf, .doc, .xls etc. are not added automatically. You will need to add them manually.
- All pages are included automatically. If you need to include or exclude specific pages, it’s not possible.
- robots.txt – In Magento 2, you can edit your robots.txt file from your admin panel itself which is very helpful and quick way for admins to manage robots.txt. But to create one, you may use this free tool – robots.txt generator. This is one of the best things the developers did while adding SEO features in Magento 2. You can find the settings at: Content –> Configuration –> Search Engine Robots.
To sum it all up…
I hope this article provided a general idea about all the SEO features that come with Magento 2 to all inquiring minds. As you can see a lot of options are available and you can use the features to optimize your Magento 2 store as the settings and configurations are still very basic and very static. It’s still better than Magento 1.x and it will surely help you improve your site’s performance in SERPs. You can also reduce TTFB in Magento 2 for better SEO.
If you have any questions or want to share any additional information feel free to drop me a line in the comments.
Make sure to share the post with fellow Magento 2 store owners via social media.
Thank you.
Rank your online store on page #1 in Google SERPs using our professional Magento SEO Services.
Shivbhadrasinh Gohil
Shivbhadrasinh is the Co-founder & Chief Marketing Officer at Meetanshi. He leads the marketing team and is the person behind the marketing & branding success of the company. Being a seasoned digital marketer, he has been consulting online businesses for growth since 2010 and has helped 100+ clients with digital marketing success.
He loves sharing tips and insights about the latest digital marketing trends aimed at helping online business owners.
2 Comments
We have learned a very useful tips from your site for building MAGENTO 2 SEO strategy.
You have explain all topics clearly..Thank You.
Thank you Shubham for the appreciation!