After writing the SEO guide for Prestashop and the SEO guidelines for a multi language eCommerce site , I couldn’t ignore Magento. Magento is considered to be one of the most challenging eCommerce platforms from a search engine optimization and development standpoint. The cause of this “bad” reputation, among other things, is to be found in the complexity of its rewrite engine, in the dependence on dynamic content and on the more complex base code than other platforms in PHP.
Do not misunderstand what I said, Magento is not a bad CMS indeed, it is the Ferrari of eCommerce, however to optimize this complex machine you need a really good and competent mechanic.
That said, all the SEO problems associated with the Magento platform can be solved by a good SEO consultant , you just need to know what to fix and where to get your hands .
In this guide I’ll tell you what to optimize, many technical fixes will likely require an in-house developer. In any case, do not ignore some valid modules regardless, all-in-one solutions such as Magento SEO Suite Ultimate extension by MageWorx able to solve various critical issues without having to put your hand to the code. This module makes things more manageable: it can set the hreflang multi language tag, fix canonical URLs, add the fateful structured data (for Magento 1.x), assign noindex rules , etc. We will review this module later in the guide.
In recent years I have provided advice to several companies with Magento-based eCommerce, meeting and solving the most varied and disparate problems. So I thought I’d document some of the more common problems in this Magento SEO guide.
Note: At the time of writing the latest version of Magento is 2.1.7 , but don’t despair if your version is different, many tips, tricks and practical improvements are also applicable for previous versions and will be for future versions.
Index:
- General configuration of Magento
- Robots.txt
- WWW vs non WWW
- HTML head settings
- CMS pages
- Category pages
- Product pages
- Search pages
- Heading
- Clean up the code
- Achieve a good loading speed
- Filters, sorts and duplicate content
- Parameter management with Google Search Console
- SessionID
- Noindex, follow for non-content pages
- Nofollow on unnecessary links
- Canonical URLs
- Pagination
- URL rewriting
- XML sitemap
- AJAX navigation
- Performance
- Redirect 301
- Rich Snippet
- Images
- Related products
- HTTPS protocol
- SEO modules for Magento
General configuration
Magento is an eCommerce platform that is quite accessible and understandable by search engines. There are several known issues that can be corrected to optimize the performance of organic results. If you are about to launch a new website with Magento I suggest you implement the following, however if you have an existing site , making these changes without the appropriate precautions can negatively impact organic visibility.
General recommendations for configuring SEO on Magento:
- Enable canonical URLs for product and category pages. Config> Catalog> Search engine optimization
- Set product URLs to the top level . Config> Catalog> Search engine optimization – Allow category path in product URLs, set to “no”
- Activate the XML Sitemap and create it Catalog> Google Sitemap
- Enable the creation of redirects when URLs are changed . Keep an eye on the rewrite if numbers are added to URLs
- Make sure you are using the latest version of Magento
- Enable URL rewriting . This setting is located in System> Configuration> Web> Search Engines Optimization
- Another thing to configure immediately in the same screen is “Add store Code to URLs”, which translated means “Add store code to URL”. Find this option under “URL options”. In most cases it is best to set this feature to “No”
These settings are the ABCs, let’s see in detail all the elements to be optimized.
Robots.txt
The Robots.txt file is very useful especially for large websites, but it can also cause problems with crawl fragmentation if used incorrectly.
I suggest using the robots.txt file if you want search engines not to crawl specific sections of the website, such as search pages, session ID pages, and filter pages generated by layered navigation. .
The robots.txt should be used to prevent pages from being crawled, but remember that there are other methods for not showing pages in search results, such as the noindex tag .
When it is not necessary to remove already indexed pages from the index I suggest blocking the following using the robots.txt file:
- Search pages
- URLs containing the string / catalog / unless there are images and CSS & JS inside this folder
- URL with session ID parameters
- Layered navigation pages (filters)
- URL with sort parameters (sort = XY)
- Administrative pages
The robots.txt would look similar (I use the * character in case you have a multi store in sub folders):
On the other hand, when it is necessary to remove the types of pages listed above from the index, it is better to use the noindex tag. Once these pages have been removed, it will be possible to remove the noindex tag and use robots.txt in order to preserve crawl budget.
I advise you to analyze the log of your web server to understand if there are particularly invasive spiders that it would be advisable to try to block.
WWW vs non-WWW
In System> Configuration> Web you will find the “Unsecure” and “Secure” tabs where you can change the base URL and set the preferred domain. You can choose between the WWW version and the non-WWW version of your URL. Changing the setting does not create an automatic redirect from WWW to non-WWW or vice versa, but only sets the preferred URL. Therefore it is a good idea to create a 301 redirect via .htaccess with mod_rewrite .
In addition to solving the WWW vs non WWW problem this redirect prevents Magento from adding the session ID to your URLs, such as? SID = a123b …
Make sure the base URL is the same as the redirect. When editing the .htaccess file you can add the following code to redirect index.php to the root.
Or, when the Magento installation is not in the root directory , but in the subdirectory such as http://example.it/magento/:
HTML head element settings
By default the Magento installation assigns the site the title “Magento Commerce”. To get the traffic your online store deserves you should keep in mind that humans and search engines give more weight to the first words they read in the title tag. If your keywords are near the top of the page title it will be more likely that a user will click on your result than a title where the searched keywords appear on the right or do not even appear.
First you have to delete the default title “Magento Commerce”. Navigate to Configuration> Design> HTML Head . Choose a good descriptive title for your website. This title will be hung on several non-content pages, with no custom title, such as “Contact Us” and “Popular Search Terms”.
To hang the store name at the end of all page titles, including category and product pages, enter the store name in “Title Suffix”. I usually suggest keeping the prefix blank to have more space to describe the product.
I recommend that you also clear the “Default Description” and “Default Keywords” fields. For a website under development, and to avoid indexing the site, it might be useful to set “Default Robots” to “NOINDEX, NOFOLLOW”. For live sites instead make sure it is set to “INDEX, FOLLOW”.
Now that you are optimizing the head section of your pages it would be a good idea to add the rel canonical tag . To enable this feature you can use the Magento SEO Suite Ultimate extension module.
CMS pages
Pages called CMS (Content Management System) are static pages that provide information about the store. These pages are managed from the control panel in the backend. Pages of this type are, for example, the homepage, the Contact page and Customer Service.
At first glance Magento might seem lacking in more typical CMS features like WordPress, but for most uses this eCommerce is quite flexible and powerful. One of the advantages of Magento is that you can control every aspect of the pages at the layout and content level. Once you’ve given each page decent content, select a Search Engine Friendly URL and page title and go to the Meta Data tab to write an original description. Remember that the quality of the texts and their originality are a critical factor for the organic visibility of a website.
You can keep the “keywords” field blank even if I personally prefer to always fill it in, especially when an AdWords campaign is active. In several tests, I found an improvement in the AdWords Quality Score after adding the most important keywords purchased with AdWords as meta keywords.
The description has a very important function: to attract people to click on your snippet on the search results page. Make sure you state what’s on the page and write an attention-grabbing sentence by trying to use a number of characters as close to 155 as possible. So, the only well-written description is a handwritten description , if you’re thinking to automatically generate meta description tags be careful of the quality of the result vials – they are phrases read by people. If you do not have the time and desire, leave the field blank, Google will take care of showing a relevant text in the search results.
Optimize category pages
With Magento it is possible to add the name of the categories to the path of the product URLs: example.it/categoria/prodotto . Since Magento doesn’t support this feature very well – it creates duplicate content issues – it’s a good idea to turn it off . To do this, navigate to System> Configuration> Catalog> Search Engine Optimization and set “Use categories path for product URL’s” to “no”.
Now it’s time to set the details for each category. Go to Catalog> Manage Categories . The most important fields to fill in with care are:
- Meta Description: enter an original and captivating description. Note that people will see the description in the search engine results list
- Page Title: Keep blank to use the category name, including the parent category name. Beware that when you customize this field the title will be exactly like your input, without the parent category
- URL key: Use short URLs but with the right keywords. Remove stop-words such as articles and conjunctions
For each language, which in Magento are defined as Store View , it is possible to specify the store name, description, page title and meta data.
If you use hierarchical URLs, which include the category name within the product page URL path, Magento generates several duplicate variants of the products in multiple categories . For this reason, I highly recommend using top-level product URLs (example.it/prodotto-page.html), as this will prevent problems like this and allow you to have only one representative version of a product.
If you are already using category paths within your product URLs, be sure to use the rel canonical tag to indicate each product’s primary address. This will fix the problem, although opting for uncategorized URLs would be the best decision.
Also, if you are moving to the top tier products, make sure you implement the proper 301 redirect rules which, by default, Magento does not implement.
Optimize product pages
Optimizing product pages is similar to what we’ve seen for category pages. It is possible to set the meta data with the “Default Values” also for each “Store View”. Note that the meta title tags will override the full title of the product and category page, except for the prefix or suffix.
An often overlooked element are images. For example by writing good alt tags for images, naming files correctly and compressing them, you can get good extra traffic from different image search engines.
By default the images will be renamed based on the product title, the same goes for the titles and alt tags. With some extra effort you can set up custom titles and alt tags for each product image. Under the tab “Images” in the product information you can set the label for each product image, this value will be used as the alt tag and title of the image. Of course you can also do this for each Store View.
Another consideration to make on the product pages is the way Magento assigns the title tags: it is usually simply the name of the product. I suggest you set up a convention to include variables based on the characteristics of the product, such as gender, color, type, brand, material, characteristic, model… Try to insert elements that the user searches for together with the type of product. An alternative is to write title tags by hand.
Configurable product or unique product?
Generally an eCommerce can sell two types of products: there are unique products, such as a TV model, and configurable products, such as a shirt available in different shades of colors and sizes. How to manage configurable products? Is it correct to have all the variants indexed or is it better to combine strength and authority for SEO purposes in a single URL?
If you use configurable products alongside simple products in Magento, you need to make sure you don’t allow indexing of duplicate variants .
Many users use simple products for features such as different colors or versions of a product, so that they can appear independently on product listing pages. This is a mistake if you leave the variants too similar to each other. If you are not intentionally creating duplicate simple products, without adding unique content to the pages, I suggest you use the canonical relational tag to tell search engines that simple products are just variations of the main configurable product.
You will also need to add the canonical teg relate to your category pages, your homepage and CMS pages, but this will need to be done manually. In newer versions, Magento automatically uses the canonical rel tag to canonize product hierarchical URLs (with category path) to top level URLs.
Search pages
A very annoying problem with Magento is when search pages are indexed by Google, as thousands of them could be indexed. These pages do not add any value to the Google index and it is better not to have them indexed. To prevent this, I recommend using the meta robots noindex tag, follow on the pages we search, or to save crawl budget use the robots.txt disallow. As mentioned, the choice of one or the other method depends on how many search pages are already indexed:
- no page is indexed: use robots.txt
- some pages are indexed: use the noindex tag until they are removed, then remove it and go to robots.txt to save crawl budget
Heading
By default the logo is inserted in an H1 tag, an important tag that should instead be used to maximize the effectiveness of a text. The most important thing is to get the title of the content in an H1 tag , for example for a category page it should be the category name and for a product the product name.
The next step is to clean up the excessive use of headers. It is a good idea to get rid of the use of headings in the side columns. There is no reason to add “static” titles and keyword-free titles with an H4. For example, it’s best to change all H4 tags to strong.
- On category pages put the product names in an H2 or H3 and the category name in an H1
- On product pages, enter the product name in an H1
Clean up the code
Move JavaScript and CSS instructions out of theme pages and put them in external files, keep theme files minimal and clean. By doing this, your users can cache external dependencies on the first page load and subsequent loads will be faster. In addition, search engines will have to crawl lighter pages, they will take less time and will be able to get more content from your webserver.
Achieve a good loading speed
A very important factor in the organic ranking of a website is the page loading speed. You can do two things to increase Magento loading speed:
- Enable caching. Navigate to System> Cache Management and enable all cache functions
- A good host and a well configured webserver. With MySQL cache and PHP opcode it is possible to improve the speed of Magento considerably, ask your developer to enable these functions
If possible try to reduce the number of external files needed to render the page, such as CSS, JS and images. For each file that the user has to download, the browser must create an HTTP connection to the webserver. So it’s a good idea to reduce the number of external files and combine several external files into one. By default Magento already merges (almost) all JavaScript files into one file. It doesn’t do this for style sheets – CSS: the default template has 6 different style sheets. It is possible to combine the contents of these style sheets into a new one, except for the print.css file which must remain separate.
Filters, sorts and duplicate content
Once you have done the optimizations seen up to this point, you will realize that the remaining problem is with the duplication of content , in many cases you could end up with a sea of duplicate content.
For each product you have in your catalog, Magento generates several URLs with very similar content:
- example.it/prodotto.html
- example.it/categoria/prodotto.html
- example.it/categoria/prodotto/view/id/1/
- example.it/categoria/prodotto/view/id/1/categoria/1/
In addition to all these duplications, there are also product review (review) pages that have pretty much the same content, and filtered or sorted listing pages. In this guide I will call filters with the term “layered navigation ” .
Layered navigation is the path offered to users by filters to select brands, features, price ranges, etc. These generated pages have contents that are not original, they are in fact a (filtered) part of the complete page and consequently should not be indexed.
Magento generates lots of duplicate pages with layered navigation and product sorting options. In essence this translates into worst case scenario product pages duplicated n times beyond the canonical – original page. To solve this problem I recommend some alternative options (do not apply all 3 or they would cancel the effects):
- insert the nofollow tag on filter links and sorting options. This option saves crawl budget
- insert the noindex tag on filtered and sorted pages. This option does not save crawl budget
- Disallow URLs with filter and sorting parameters. This option saves crawl budget
I regularly choose to use the noindex directive to instruct search engines not to index layered navigation pages. You can use meta robots tags or the X-Robots HTTP header to do this, both methods send the same message to search engines and meet the requirements for removal requests in Google Search Console .
The main benefit of using noindex, follow is that search engines can still crawl pages and page links, but are instructed not to index them. For this purpose you can use one of the many SEO modules for Magento that allow you to assign meta robot rules by hand.
If you are using the multi-select option on layered browsing or if you are having trouble with crawl budget I suggest you block the URLs with a Disallow in robots.txt.
Parameter management with Google Search Console
When developing sites that use parameters in URLs , it is good and right to educate Googlebot about the function of each parameter. Only by helping Google to understand the function of each parameter will it be possible to obtain correct indexing.
Log in to Google Search Console, go to the “Scanning” section and then to “Parameters”. Using the “Edit” button, to the right of each identified parameter, assigns a function specifying whether the relative URLs should be scanned (and subsequently indexed) or not.
Generally, the filtering and sorting parameters are not indexed, while the translation and selection parameters are.
SessionID
The SessionID parameters are used to register a user session, commonly when moving from one store to another in a Magento installation. These pages can cause duplicate content issues if they are indexed and there is no limit to the amount of URLs that can be generated. If you are having trouble with session IDs, I suggest you remove this parameter or use robots.txt files or meta robots tags to prevent them from being indexed.
Noindex, follow for non-content pages
Ask your developer to insert the meta robots tag noindex, follow on the following types of pages:
- Send friend
- Product review page
- tags
- RSS feeds
- Product appears
- Wishlist
- Customer account
- Checkout pages
- Contact us form
- Catalog search
- Advanced search
- Search terms
Now the search engine will follow all links on these pages but will not display those pages in the index.
Note: these are general indications, each eCommerce site has its own peculiarities and the list just shown may not fit everyone indiscriminately. I’ve seen eCommerce make a lot of organic traffic with product comparison pages and others don’t even make a visit to that type of page. How to do? If those pages were open to search engines you can study their performance. Look at the data from Analytics and Google Search Console, evaluate whether those pages have value for Google or not and decide whether to exclude them or not.
Nofollow on unnecessary links
Another easy step to improve the SEO of your eCommerce is to stop linking to the login page, checkout, wishlist and all other sub-pages, if not strictly necessary. The same goes for your RSS feeds, layered navigation, add to wishlist and add to comparison link , etc. I don’t know any plugins that fix this problem, the best way is to edit the theme files by adding the nofollow tag to these links.
Canonical URLs
To help search engines understand the duplicate content of your pages, you can suggest the preferred version of the URL for each page using a canonical URL, therefore you should navigate to System> Configuration and enable the “Use Canonical Link Meta Tag For Products “.
For category pages, however, it’s not that simple. Disable the “Use Canonical Link Meta Tag For Categories” function, navigate to Catalog -> Manage Categories> Custom Design> Custom Layout Update and insert the following script making the appropriate changes.
The rel canonical tag can be a very good solution for duplicate pages, however I have a couple of reservations about it:
- I have seen on many occasions search engines ignore the rel canonical tag if the pages are very different in content
- if you already have the pages in the index and you need to fix the problem quickly, the rel canonical tag can take a long time to be understood by Google and other search engines
Pagination Tag obsolete
Listing (product listing) pages use pagination to break up large lists, which usually means that the same content is used in different variations of the same page. These pages should use the rel next and rel prev tags . These tags were introduced by Google in 2011 to improve the management of archive pages that will no longer be viewed as a multitude but as single entities.
The rel next and prev tags must be added in the head section of the HTML of the listing pages:
In some cases it might be useful to combine a noindex, follow to rel next and rel prev.
URL rewriting
A surprisingly common problem with Magento is URL rewriting. I happened to see the URL of a category or product page being converted to the original / catalog / without a 301 redirect, thus generating duplication. I recommend blocking these URLs and keeping them monitored with constant website scans.
It may happen that the Magento rewrite adds a number at the end of product and category URLs, for example -1, -2, -3. This happens when an existing URL path is already in use and the rewrites replace the original URL without changing it. This can be a huge problem and usually requires developer intervention.
The added number can also be caused by updating products by uploading a CSV file . When this happens, you simply have to ask your developer to remove the rewrites from the rewrite table. But be careful, this activity is delicate, it should be tested before applying the changes to your live site.
XML sitemap
Magento is known for creating sitemap.xml that is certainly not optimal as it only provides the ability to create a unique sitemap that often contains pages that you don’t want to index.
The sitemap.xml is an easy way to let search engines know where your content is, it won’t help you rank better, but it might help you get indexed faster. You can manually create an XML Sitemap by clicking Catalog> Google Sitemap> Add Sitemap , choosing a filename, path and archive view and then pressing “Save & Generate”. Alternatively you can use external modules to generate the sitemap.xml.
I usually suggest creating two Sitemaps.xml, one for the products and one for the category and content pages. This allows for better visibility of page indexing (via Google Search Console). For very large websites, I usually suggest dividing the products by brand or type, providing even greater insight into indexing. You could then refer to the different sitemaps in an index sitemap.
When the sitemap.xml is ready don’t forget to insert its URL in the robots.txt file, simply adding the following in the last line (with the appropriate modifications):
Sitemap: http://esempio.it/sitemap.xml
Since the inventory usually changes constantly, you have to recreate the sitemaps.xml every time. To make sure you always have an updated sitemap.xml, the best way is to set up a CRON JOB, the process of which is fully described in the official guide .
AJAX navigation
Using AJAX-based navigation allows you to filter the products on your website without changing the URL. If you don’t have an experienced Magento developer, you are probably having a bad nightmare.
There are modules that can help improve AJAX navigation, but to be honest if you don’t have the support of a good developer I’d avoid modifications of any kind.
AJAX browsing can cause a lot of indexing problems. I have seen eCommerce sites with AJAX navigation and Robots.txt blocking access to their files, on multiple occasions.
If you are using AJAX for layered navigation, make sure the filters do not generate true URLs as this can cause further problems with dynamic pages being indexed, even if the URLs are not actively visible while browsing the site.
Performance
Magento is not a lightning bolt in uploads, in very serious cases this slowness can have a negative impact on the organic search ranking. The speed of a website also has an impact on crawling: the faster the site loads, the more pages will be able to download bots in a given amount of time. For these motorbikes, performance optimization is very important for larger sites. There are several things you can do to optimize the speed of your Magento website, such as:
- Use an optimized and well configured web server
- Disable Magento logs (logs) and enable registry cleanup
- Enable the merging of CSS and javascript
- Take advantage of the browser cache
- Use a CDN for images (see also image compression services)
- Front-end asset optimization
- Enable GZIP compression on the web server
I always suggest this lineup to improve the user experience and maximize conversions. Make sure your developers can allocate the right time for performance improvement in order to optimize the speed of your store.
Test your eCommerce with tools suitable for evaluating performance, such as GTmetrix .
Redirect 301
By default, older versions of Magento use 302 redirects which are not optimal from an SEO point of view. I recommend that your redirects be set to 301 to get as much PageRank out of your links as possible.
Rich snippet
One of the most interesting improvements introduced by Magento 2 is certainly the inclusion of Rich Snippets. This new feature helps SEO and CTR in organic results. This feature is enabled by default in Magento 2, there is no need to set it. If your CMS instead is of previous versions then you have to get your hands dirty and enter structured data via PHP.
Images
To optimize the images I recommend that you follow this dedicated guide which is always valid. To put it briefly: rename filenames neatly, resize images to the right size, compress them as much as possible, and insert a comprehensive alt tag.
Another important SEO feature of Magento 2 is the ability to use product labels. This feature was also available for Magento 1.x versions, but only using third party extensions.
Related products
In Magento 2 3 types of relationship between products are created. We find the Up-Sell product, that is, that product we want to push, generally it is a more expensive and better quality product.
Then there are the Cross-Sell products, i.e. products different from the product that the customer is buying, but which are still related to it.
Finally we find the Related Products , which are products strictly linked to the product viewed by the user. These products are additional items that the customer can purchase, along with the product he is viewing.
Implementing related product boxes is good for the internal link structure , improves usability and navigation between products as well as making life easier for spiders who will find links to new products more quickly.
HTTPS protocol
In my opinion this paragraph was not needed but I will avoid misunderstandings two lines. Does your eCommerce accept credit cards and personal data ? Still need to tell you that you need to migrate to HTTPS ?
SEO modules for Magento
Lately I have been using Magento SEO Suite Ultimate extension v9.3.0, a very complete SEO module for Magento, which has been around for a long time.
The MageWorx module offers many SEO features, including:
- Support for the Hreflang tag . It includes many options to ensure it is best implemented on your eCommerce pages
- Options for configuring the product catalog. This is a commonly requested feature in all those cases where variants of the same product are sold, usually simple, bundled or configurable products. The module allows you to configure canonical URLs to essentially refer to the primary versions of the URL. So, for example, if you have a shirt that is a configurable product with different size or color versions, you can set the canonical URL
- Manage meta robots tags. This is a feature I use on all the online stores I work with. You can set rules (with wildcards – wildcards) to assign meta robots tags to groups of pages (e.g. noindex, follow for all URLs containing ? Price = ).
- Possibility to modify the robots.txt file from the Magento backend
- Check for duplicate HTTPS / HTTP URLs
- Ability to create more advanced rules for canonical URLs (for things like slash handling etc.)
- Options to rewrite URLs
- Options related to the creation of conventions for writing the title tag
- Advanced sitemap.xml creation options
- Options for managing pagination
- The ability to override or override other settings at the individual store level
These are just some of the features, but there are many more. This module is certainly one of the most appreciated by Magento eCommerce owners and agencies.
Other SEO modules for Magento that I consider valid are:
- Magento Sitemap Suite extension v4.6.3 : autonomous module to extend the Magento sitemap)
- Mirasvit module – good module covering the fundamentals and some extra options
This article has covered the critical aspects of getting good SEO from Magento. If you have any comments, questions or additions, please let me know so I can keep improving this article.