Magento 2 is by far the best e-commerce platform for SEO friendly features straight out of the box. This guide will show you how to configure Magento 2 SEO settings for higher SERP ranks and driving amazing organic traffic to your Magento website.
Magento 2 SEO planning has following sections which need to be optimized:
- Home Page Titles
- Robots.txt Settings – Optimizing Crawler behavior
- Category and Product Pages
- Magento Templates and External Files
- Image Optimization
First things to do when optimizing your Magento website is to make changes to these general settings:
- Go to Stores -> Configuration -> Web -> Search Engines Optimization, and turn “Use Web Server Rewrites” to “Yes”. This enables us to rewrite URL keys for our pages to make them more SEO friendly. When redirects are applied, existing URLs point to the new address.You can add and edit URL rewrites in the Marketing -> URL Rewrites section.
- In Stores -> Configuration -> Web -> URL Options, change “Add Store Code to URLs” to “No”. This setting removes the store code from page URLs, making URLs light and junk free.
- Another thing to look out for is the default store name Magento sets on your first install, i.e., “Magento Commerce”. This title is used for pages like “Contact Us” which are non-content pages. You can change the title by going to Content -> Configuration. Then click on “Edit” in Actions for the Main Website Store. Expand the HTML Head section and change the “Default Title” to your store name.While you’re configuring the HTML Head section, use “Title Suffix” to add store name to all page titles including category pages and product pages. “Title Prefix”, “Default Description” and “Default Keywords” should usually be kept empty.
Optimizing for Home Page
The home page of a website is most likely to rank highest in search results page (SERP) on a search engine. It is also the page to which you get most backlinks to. So it is a must to optimize your Home Page for SEO.
- By default, Magento 2 assigns “Home Page” title to your home page. It should be changed to a more relevant and unique title. You can do that by going to Content -> Pages. Click on “Edit” settings for the home page. Expand the Search Engine Optimization section and add “Meta Title” and “Meta Description” for your home page.This can be done for all CMS pages you want to rank for.Tip: Description has a very important task, to get people’s attention and to make them click on your website on the search results page. So make sure that the title and meta description are well written and descriptive. Try to make use of the first few words of the title and description as they get the most attention span of searchers.
Robots.txt Settings – Optimizing Crawler Behaviour
Robots.txt settings tell the search engine crawlers which page to index in Google databases. You can edit Robots.txt settings by going to Stores -> Configuration -> General -> Design and changing the “Default Robots” setting to your preference.
- For areas of the website used for development and testing should not be indexed by Google. So for non-production environment, set Default Robots to: “NoIndex, NoFollow”
- For all other applications, set the Default Robots to: “Index, Follow”
Optimizing Category Pages
- Magento 2 adds category names to product URLs automatically. But this feature causes duplicate content issue, hence should be turned off. You can do this by going to: Stores -> Configuration -> Catalog -> Catalog. Expand Search Engine Optimization section and set “Use Categories Path for Product URLs” to “No”.
- To add meta title and description to Categories, go to Products -> Categories. Select whether you want to add Category meta data to a single store or all stores from the “Store View” dropdown list on the top of the settings page. Select the category you want to add meta data to, from the Category tree on the left sidebar. Expand Search Engine Optimization section and add “Meta Title” and “Meta Description” for that category.You can also add a URL key to the selected Category instead of a system generated one in the same section. This will be set only for “All Stores” view.A few things to keep in mind while changing Category meta title and URL key are:
- If you are customizing the Page Title, it will be shown exactly as you’ve put it. If you want to use Parent category name as the page title, leave the “Meta Title” empty.
- If you have a multi language store, keep the URL key independent of languages.
Optimizing Product Pages
Product page meta data can be optimized the same way as Category pages. They can be set for individual or “All Store Views”. Go to Products -> Catalog and click on the product ID you want to add title and description to. Expand Search Engine Optimization section and add “Meta Title” and “Meta Description”. Just like for categories, you can add an SEO friendly product “URL key” under this section as well.
Some products have different attributes due to which they require individual pages. For each page made for a unique attribute, the description remains the same. For example, different colors of a designer t-shirt. To mitigate duplicate content showing up in Catalogs and search results, visibility settings much be changed. Go to Products -> Catalog and click on the product ID you want to change visibility for. Change the “Visibility” settings to “Not Visible Individually” for duplicate pages.
Optimizing Magento Templates
- By default, Magento assigns an <h1> tag to logos. An <h1> tag denotes a page heading, and it should be relevant to the content of the page. For SEO best practices, a logo should be tagged as <h1> only on the home page and at best an <h3> on other pages.
- Caching should be enabled for all cache types for greater Magento website speeds. These caches include configuration, layouts, translations, collections data, EAV types, and attributes etc. Go to System -> Cache Management to enable/disable cache settings.
A major factor in SEO best practices is adding Alt texts to images. This lets users using screen readers or accessibility options to know what the image is about. Another reason why images must be optimized for is page load speed. If the image is heavy, product page will take longer to load, which will result in user dissatisfaction.
You can add Alt text to product images by going to Product -> Catalog and click on the Product ID for which you want to change settings. Expand the “Images and Videos” section and click on the product image to add Alt text.
Alt text for company logo image by default is “Magento Commerce”. You can change this to your company name by going to Content -> Configuration and select the page you want to change settings for. Expand “Header” section and add “Logo Image Alt”.
Putting it all together
Magento team has made a lot of changes from Magento 1.x versions to make Magento 2 SEO friendly. Its out of the box features if configured and used correctly, along with a few extensions can create SEO magic for your Magento store.
At Humcommerce, we strive to be the best as Magento service providers. Our in-house SEO talent keeps themselves up-to-date with current search trends. We would like to know what challenges you are facing in your endeavor to e-commerce success and how we can help you achieve it.