Magento SEO: Magento 2 and Magento 1 SEO Optimization Guide

Magento is an e-Commerce platform based on open-source technology that allows control over functionality, appearance and content in a very flexible way. In this guide we see in detail the main best practices to improve Magento SEO.

Through the complete guide to Magento SEO optimization you will discover:

  • Magento features
    • Promotion and Marketing Tools
    • Analysis and Report
    • Search Engine Optimization
    • Site management
    • Catalog management
    • Browsing the catalog
    • Product details
    • Checkout
    • Terms of payment
  • Magento SEO Checklist
    • URL optimization
      • URL rewrite
      • Index.php removal
      • URL suffixes
    • Header optimization
    • Duplications
      • Duplicate products
      • Rel canonical
    • Sitemap xml
    • Usability
      • HTML sitemap
      • Breadcrumbs
    • Web Performance
      • Magento cache
      • Gzip compression
      • MySQL Query Cache
    • Multilingual store optimization
  • Conclusions

Please note : the guide is mainly based on Magento 2 being the most recent version. Nevertheless, since many shops still use Magento 1, I have also reported the paths of version 1.9.


1. Magento features

The platform was launched in March 2008 by Varien with GPL license, but after about a year the software house has seen fit to release the Enterprise version, for a fee, while keeping the Community version free.

To date Magento boasts several million downloads, and has established, according to many developers, new standards in the creation of e-commerce.

On the official website of Magento it is possible to compare the costs and characteristics of the available editions and the requirements for installation, consult the guides useful for both developers and retailers and discuss with other developers through the forum, where there is also a section in English.

The intuitive control panel provides powerful marketing tools, search engine optimization and catalog management that allow you to create an online store that suits your needs.

Here are the main features of Magento divided by type:

  • Promotion and Marketing Tools
  • Analysis and Report
  • Search Engine Optimization
  • Site management
  • Catalog management
  • Browsing the catalog
  • Product details
  • Checkout
  • Terms of payment

1.a) Promotion and Marketing Tools

  • Discount coupons with the ability to limit them to stores, customer groups, time periods, categories and products;
  • Catalog with promotional prices;
  • Free shipping option;
  • Discounts for combined purchases.

1.b) Analysis and Report

  • Administration panel with general report;
  • Discounts and taxes report;
  • Dashboard on the best-selling products, the most viewed products and the best customers based on the number and quantity of orders;
  • Abandoned carts report.

1.c) Search Engine Optimization

  • Google sitemap xml creation;
  • Total control of URLs via URL rewrite;
  • Customization of meta tags for products and categories;
  • Automatic generation of the most searched terms.

1.d) Site management

  • Management of multiple websites and shops from a single administration panel;
  • Web Services API for easy integration between Magento and other applications;
  • Currency and language management;
  • Control over access permissions to the administration panel.

1.e) Catalog management

  • Catalog import and export;
  • Integration with Google Merchant Center;
  • Sale / download of digital products;
  • Tax management for locations, customers and product categories.

1.f) Browsing the catalog

  • Filter products in categories;
  • Product comparison;
  • Filter products in search results;
  • Possibility of associating different layouts to each product or product category.

1.g) Product details

  • Cards with multiple images;
  • Zoom on images;
  • Related products;
  • Posting reviews.

1.h) Checkout

  • One page checkout;
  • Purchases without registration;
  • Cart with taxes and shipping costs in sight;
  • Shipping to multiple addresses in one order.

1.i) Terms of payment

  • Amazon Payment;
  • Paypal;
  • Google Checkout;
  • Credit cards;

2. Magento SEO Checklist

From an SEO point of view, Magento presents itself as a rather intuitive platform to be optimized, but as with all CMS you need to know the main best practices that allow you to have an online store more predisposed to  positioning on Google.

Let’s start by delving into the most important settings to make Magento SEO friendly.

Please note : although I will deal with not particularly complex configurations, it is preferable to make a backup of the files that will be edited and, if you are not sure what you are doing, perhaps it is better that you entrust the work to an expert SEO consultant.

Checklist index:

  • URL optimization
    • URL rewrite
    • Index.php removal
    • URL suffixes
  • Header optimization
  • Duplications
    • Duplicate products
    • Rel canonical
  • Sitemap xml
  • Usability
    • HTML sitemap
    • Breadcrumbs
  • Web Performance
    • Magento cache
    • Gzip compression
    • MySQL Query Cache
  • Multilingual store optimization

2.1) URL optimization

One of the most important techniques in search engine optimization is the use of SEO friendly URLs.

In this section we explore how to optimize URLs through:

  • URL rewrite
  • Index.php removal
  • URL suffixes

2.1.a) URL rewrite

The first step towards the optimization of Magento concerns the rewriting of the URLs that will allow you to obtain SEO friendly URLs for our shop, such as:

www.abc.com/category/product.html

instead of

www.abc.com/catalog/product/view/id/01/category/01

To activate the URL rewrite you need to:

Magento 1:

  • Go to System> Configuration> General> Web> Search Engine Optimization;
  • Set Use Web Server Rewrites to Yes.

Magento 2:

  • Go to Store> Configuration> General> Web> Search Engine Optimization;
  • Set Use Web Server Rewrites to Yes.

Furthermore, for both versions of Magento, in the “Url Options” tab, the “Auto-redirect to Base URL” option must be set to Yes (301 Moved Permanently).

In this way we use the 301 redirect instead of the 302 for the Base URL (for example to redirect from https:/abc.com/store/ to https://www.abc.com/store/).

2.1.b) Index.php removal

Another trick for optimizing URLs is to remove index.php from all URLs.

To do this you need to edit the .htaccess file located in the root of the Magento installation, at the line:

RewriteBase / magento /

and add “#” to comment the line

#RewriteBase / magento /

or, as reported in other SEO guides, replace / magento / with /:

RewriteBase /

2.1.c) URL suffixes

Finally, to finish optimizing the URLs, you will need to set the suffixes correctly: “/” for categories and “.html” for products and pages. To set this setting you need to:

Magento 1:

  • Go to the System> Configuration> Catalog> Search Engine Optimization tab;
  • Enter in the fields “Product URL Suffix” and “Category URL Suffix” respectively .html and /.

Magento 2:

  • Go to Store> Configuration> Catalog> Catalog> Search Engine Optimization;
  • Insert in the fields “Product URL Suffix” and “Category URL Suffix” respectively .html and /, just like in the image.

2.2) Header optimization

To optimize the header you need to go to the following tabs:

Magento 1: go to System> Configuration> Design> HTML Head;

Magento 2: go to Content> Configuration> Design> Select the Store> HTML Head;

In these tabs we can therefore optimize:

Favicon Icon : if you want to use a custom favicon, from here you can upload an image in .png .jpg .ico .gif .apng or .svg format

Default Page Title: The default title tag that will be used for pages without a custom title.

Page Title Prefix: prefix that can be added to the default title. It is advisable not to compile it.

Page Title Suffix: suffix that can be added to the default title. It is advisable to fill it in with the Brand of your shop.

Default Description: The default description meta tag that will be used for pages without a custom meta description.

Default Meta Keywords: the default keywords meta tag. It is advisable not to compile it.

Scripts and Style Sheets: in this field it is possible to insert one or more scripts, which will be inserted just before the closing of the header, such as the Google Analytics script;

Display Demo Store Notice: used to display a message informing users that the site is in demo version.

In Magento 2, again in this tab, by clicking on the “Search Engine Robots” tab, it will be possible to set the directives for the robots meta tag under “Default Robots”.


2.3) Duplications

Duplication of content has always been a great enemy of SEO.

When there are multiple URLs that feature the same content, search engines don’t know which page to show in the SERPs and tend to downgrade all duplicate pages.

This circumstance damages the positioning of a site in a serious and significant way. So let’s see how to deal with:

  • Duplicate products
  • Rel canonical

2.3.a) Duplicate products

It is very common for a product to be combined with multiple categories, causing duplicate content problems since different URLs allow you to reach the same product page (for more information see penalties from Google Panda).

If, for example, we find ourselves managing an online wine shop and we have organized the Magento categories in order to catalog the products by:

  • type (red wines, white wines, sparkling wines, etc.);
  • for Winery;
  • by Region (Lombardy, Piedmont, Lazio, etc);

and the same wine is also shown on the home page as a product on offer, surely we will have 4 different URLs that lead to the same product:

  1. www.example.com/product.html;
  2. www.example.com/typology/product.html;
  3. www.example.com/enterprise-category/product.html;
  4. www.example.com/region/product.html

This problem can be overcome by disabling the inclusion of category names in product URLs. To do it:

Magento 1:

  • go to System> Configuration> Catalog> Search Engine Optimization;
  • set “Use Categories Path for Product URLs” to No.

Magento 2:

  • go to Stores> Configuration> Catalog> Catalog> Search Engine Optimization;
  • set “Use Categories Path for Product URLs” to No, as in the image below.

In this way we will have URLs of the type mionegozio.it/prodotto.html for all products, without the category, thus solving this potential problem.

2.3.b) Rel Canonical

The Canonical Rel is a fundamental tool in SEO for e-commerce, as it tells search engines which of the various versions of a page is the one to consider.

Correct implementation of this tag solves many systemic duplication problems . To activate it:

Magento 1:

  • go to System> Configuration> Catalog ”> Search Engine Optimization;
  • enable canonical for product pages by setting “Use Canonical Link Meta Tag For Categories” to Yes;
  • enable canonical for product pages by setting “Use Canonical Link Meta Tag For Products” to Yes.

Magento 2:

  • go to Stores> Configuration> Catalog> Catalog> Search Engine Optimization;
  • enable canonical for product pages by setting “Use Canonical Link Meta Tag For Categories” to Yes;
  • Enable canonical for product pages by setting “Use Canonical Link Meta Tag For Products” to Yes, as shown in the image:
magento canonical

2.4) XML sitemap

The xml sitemap is essential to speed up the indexing of product sheets, especially for e-commerce that draws from the feeds of large suppliers.

To create a sitemap in XML format the procedure on Magento 1 differs considerably from Magento 2.

2.4.a) Creating an XML sitemap in Magento 1

To generate an xml sitemap in Magento 1, from the “Catalog” menu just go to the “Google Sitemap” page, click on “Add Sitemap” and fill in the fields:

  • Filename: the name of the file (usually sitemap.xml);
  • Path: the address where the sitemap will be saved, enter “/” if you want to save it in the root.

Immediately after you have to click on Save & Generate to create the sitemap file.

The last step is to have the xml sitemap update automatically. To that end:

  • Go to System> Configuration> Catalog> Google Sitemap;
  • In “Generation Settings” set the Enabled field to Yes.

After these two steps the xml sitemap will update automatically, but remember to set the file permissions to “777” to allow automatic rewriting.

Create an XML sitemap in Magento 2

To generate an xml sitemap in Magento 2 you need to:

1) Go to in Stores> Configuration> Catalog> XML Sitemap.

2) Optionally configure the frequency and priority of content updates in the Categories Options, Products Options and CMS Pages Options sections.

3) Configure the generation settings by setting the Enabled in the Yes field, so that the xml sitemap is generated automatically.

4) Optionally configure the sitemap file limits. The default limit of 50,000 URLs is correct and is fine in most cases.

5) Finally in the “Search Engine Submission Settings” section set Enable Submission to Robots.txt to Yes if you want a reference to the xml sitemap to be inserted in the robots.txt file.

That’s all. Now you know how to generate an xml sitemap in Magento 2, which you can submit to Google Search Console  and Bing Webmaster Tools to improve your website ‘s indexing speed.


2.5) Usability

While carrying out an SEO Service campaign, the first thing to do, even before the optimization of the contents and the development of the backlinks , is to make sure that your site has been designed in a user-friendly way.

Our site must be easy to navigate and help users find all available information.

This will greatly improve the search engine ranking of our Magento shop. So let’s see how to improve usability with:

  • HTML sitemap
  • Breadcrumbs

2.5.a) Sitemap in HTML format

To activate an automatically generated HTML sitemap , in Magento 1 you must:

  • go to System> Configuration> Catalog> Catalog;
  • set “Use Tree Like Category Sitemap” to Yes.

Unlike Magento 1 where you can generate the HTML sitemap by default (as we have just seen), Magento 2 does not support this feature.

Therefore you will have to rely on third party modules to provide a detailed map of your site.

2.5.b) Breadcrumbs

Breadcrumbs help users keep track of their locations as they navigate the site.

Users can quickly return to the previous page with a simple click on any link traced in the path.

While for categories and product pages they are usually enabled by default, to add breadcrumbs also in the CMS page you have to:

Magento 1:

  • go to System> Configuration> General> Web;
  • in the Default Pages section set “Show Breadcrumbs for CMS Pages” to Yes.

Magento 2:

  • go to Stores> Configuration> General> Web;
  • in the Default Pages section set “Show Breadcrumbs for CMS Pages” to Yes, as shown in the image:

2.6) Web Performance

One of the weaknesses of Magento is, in my opinion, the page navigation speed .

This aspect affects 2 very important factors:

  1. The first is certainly the user experience of our potential and existing customers, who may decide to leave the shop if they get too bored to access the desired pages;
  2. The second concerns the crawling phase of the search engine crawlers that could download fewer pages from our site, if these were returned too slowly from our server.

Let’s see in detail, how to improve web performance through:

  • Magento cache
  • Gzip compression
  • MySQL Query Cache

2.6.a) Magento cache

To improve the perception of speed of our shop, one of the first operations to be carried out concerns the activation of the cache. To do this in both Magento 1 and Magento 2:

  • go to System> Cache Management;
  • enable all available cache types.

In case some type of cache is invalidated, it usually resolves by clicking on “Flush Magento Cache”.

2.6.b) Gzip compression

Activating Gzip compression could significantly increase the loading speed of Magento pages.

To activate it, simply uncomment the line of the .htaccess file:

## enable resulting html compression
php_flag zlib.output_compression on

2.6.c) MySQL Query Cache

Magento is a database application , this means that it performs various access and read operations to the database during its use.

Many of these access and read requests are repeated over time, so to speed up these operations you can enable the cache for MySQL queries.

To check if the cache is active on our database, just enter phpMyAdmin and execute the query:

SHOW VARIABLES LIKE 'have_query_cache';

while to view the amount of memory dedicated to the cache , the query is:

SHOW VARIABLES LIKE 'query_cache_size';

Database servers with 1Gb of RAM can safely handle a 64Mb cache.

To activate, in case it is disabled, and set the cache, simply execute the following query, which sets it to 64Mb:

SET GLOBAL query_cache_size = 67108864;

2.7 Multilingual Store Optimization

An SEO problem of those who manage multilingual stores with Magento is the generation of duplicate URLs due to the addition of the parameters “___store” and “___from_store” to the URL when we pass from one store view to another.

The “___store” parameter is used by Magento to know exactly which store to instantiate and is necessary when we manually define the URL to which a certain store view must respond.

In order not to make it more necessary and therefore avoid it being added, the simplest way is to use “talking” store code for our store views (for example “en” for English) and instruct Magento to add the store independently. queue to the URL.

This simple configuration can be found on:

Magento 1: System> Configuration> Web> Url Options;

Magento 2: Store> Configuration> General> Web> Url Options;

where for both versions of Magento, the “Add Store Code to Urls” option in the “Url Options” tab must be set to No.

To remove, however, the parameter “___from_store”, more useful for statistical purposes than functional, you need to apply a small change to the template, adding the parameter “false” to the function that determines the URL of the content in another language.

In the file:

/ app / design / frontend / [my package] / [my theme] /template/page/switch/languages.phtml

edit the call:

<! -? php echo $ _lang ---> getCurrentUrl ()?>

with:

<! -? php echo $ _lang ---> getCurrentUrl (false)?>

These simple indications are essential to prepare the Magento store for international SEO positioning for multilingual sites.


Conclusions

This comprehensive guide has covered all the main aspects of Magento SEO optimization .

Of course, each store has its own characteristics and consequently needs specific optimizations studied ad hoc through an SEO audit to obtain the best positioning results.

For professional support, please don’t hesitate to contact us.

For more information, feedback or suggestions, please feel free to use the comments.


Leave a Reply

Your email address will not be published. Required fields are marked *

Top
WhatsApp WhatsApp us