Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
  1. Code
  2. Magento

A Comprehensive Approach to Magento SEO: The Basics

This post is part of a series called Magento SEO.
Magento SEO: Optimizing Pages and Avoiding Duplicate Content Penalties

This is the first part of a four-article series in which we'll explore Magento Search Engine Optimization techniques in detail. In this article, you'll learn how to develop an effective keyword strategy for your Magento website, some general Magento admin panel configurations to make it more SEO friendly, how to create the robot.txt and sitemap.xml files, and how to set up Google Analytics for a Magento store.

One of the hallmarks of Magento, which distinguishes it from other eCommerce CMSs, is the extent of customization it offers. In Magento, unlike most other eCommerce CMSs, we have the flexibility to customize every page, every product, and every snippet of code within its framework for search engines. 

In this series, we’ll cover all the fundamentals you need to know to best equip your Magento website to rank well in search engine result pages, giving a boost to your sales and revenues.

Planning a Keyword Strategy

All SEO optimization campaigns start with effective planning of a keyword strategy. This is also true when it comes to eCommerce platforms. While planning a keyword strategy for an eCommerce platform, we have to maintain an effective balance between three important factors:

  1. Relevance means that the page optimized for specific keyword(s) should have relevant content on it. 
  2. Purpose implies that the content of the page should also direct users towards the ultimate purpose of the website, i.e. to drive sales.
  3. Structure means that page's authority from an SEO perspective is inversely proportional to its depth in the website structure. Therefore, the homepage has more authority than a product or CMS page. Hence, a homepage should be optimized for more broad and competitive keywords, while the pages deep in the website structure should be optimized for more specific and less competitive keywords.
Planning a keyword strategy for SEO

To have an effective keyword strategy, we have to consider each of these three factors. We have to ensure that our keyword resides on the page with enough strength to enable to it to perform, and we also have to guarantee that it is sufficiently relevant to the page’s content to keep the visitor engaged. This should all help in accomplishing the main purpose of the website.

Magento Admin Panel Configurations for SEO

Once we have an effective keyword strategy developed, it’s time to start preparing our Magento store for Search Engine Optimization. The first place to start is with the Magento admin panel configurations, as they are the easiest and quickest configurations to update.

First of all, we’ll go to Magento Admin Panel > System > Configuration > Web. Here, from the URL Options tab, we’ll change the Auto-redirect to Base URL to Yes (301 Moved Permanently). This will remove the redundant index.php that is appended to the base URL. 

Then, from the Search Engine Optimization tab, we’ll change Use Web Server Rewrites to Yes. This will auto-redirect to the base URL in case the domain is typed without the "www" prefix.

URL options

Next we’ll make a couple of changes in System > Configuration > Catalog > Search Engine Optimizations. Here you’ll see these default settings:

Default Magento SEO settings

On this screen, we’ll set Use Categories Path for Product URLs to No. The rationale behind this is that products can be accessed from two different URLs in Magento:

  1. With a category name in the URL, like http://myexamplestore.com/category/subcategory/product.html
  2. Without a category name in the URL, like http://myexampledomain.com/product.html

When a search crawler accesses the same page through two different URLs, it thinks we are duplicating content across two pages. By setting Use Categories Path for Product URLs to No, we disable the product path with the category name in the URL, thus leaving only one path to access the product page. This will help us avoid duplicate content penalties. 

To further reduce the chances of duplicate content penalties, we’ll turn Use Canonical Link Meta Tag for Categories and Use Canonical Link Meta Tag for Products to Yes. A more in-depth explanation about canonical tags will be provided in the next article in this series.

Our next step will be to define store default settings for title, description, and keywords. Magento uses a fallback approach to determine the value of these tags. 

First, it will look to see if any category or CMS page has specifically defined values for these tags. If it finds them, it will use them as first preference. If there is no such tag specifically defined for an individual category or CMS page, it will try to populate these itself by resorting to store default settings. 

For products, however, it uses a different approach. For products it pre-populates product name as "title", product description as "description" and product name as "keyword". To edit the default settings, go to System > Configuration > Design > HTML Head.

HTML Head settings in Magento

On the same page you’ll see settings for Default Robots. Select INDEX, FOLLOW from the drop-down to allow search engines to index your store’s web pages and follow the links found therein.

Setting Up an XML Sitemap

Creating a well-structured XML sitemap is a long-established practice to make it easier for search engines to index the pages of the website. Creating and maintaining the XML sitemap of an eCommerce website can be a particularly daunting task, as there could be thousands of products, under hundreds of categories and subcategories. 

To make this possible for its users, the Magento team has created an XML sitemap generator within Magento. To configure Magento Sitemap, go to System > Configuration > Google Sitemap and configure the Frequency and the Priority of sitemap generation.

For most eCommerce websites, the first priority should be given to the category pages, as they serve as the main landing pages for most search terms. Next in priority come the product pages, which users reach if they search for a particular product. Last in priority are the CMS pages, which contain static content for the website. 

For the update frequency, I would recommend having your category and products updated on a daily basis in sitemap, while the CMS pages could be updated on a weekly basis, as changes don’t occur in them very frequently. In a nutshell, your sitemap settings should look broadly like the below screenshot. 

If you think you add/edit new products or categories much less often than that, you can modify these settings accordingly.

Google Sitemap settings in Magento

Once the correct XML Sitemap settings are in place, the next step is to generate the sitemap. For this, go to Catalog > Google Sitemap and click on Add Sitemap. Enter any file name of your choice, e.g.  sitemap.xml, and for Path just enter /, as we want to place the sitemap at the root URL. 

Now hit the Save and Generate button.

Add a new sitemap in Magento

To verify that you have a working sitemap in place, visit the sitemap URL to confirm, e.g. http://myexamplestore.com/sitemap.xml.

Robot.txt Settings

robot.txt files are particularly important as the main way of communicating with search engine crawlers. Through the robot.txt file, we can tell search engines which pages to index and follow and which pages to avoid. Some other important information like the location of the sitemap is also communicated via the robot.txt file.

In order to prepare our robot.txt file for our Magento installation, first of all we’ll make sure that search engines notice and keep track of our sitemap file. To accomplish this, we'll add this line in our robot.txt file:

Next, we want to stop search engines from crawling our checkout, review, and catalog search pages. To do this we’ll add these lines into our robot.txt file:

Now, to avoid duplicate content penalties, we’ll add these two lines as well, to avoid indexing of duplicate pages of categories and products:

Configuration for Google Analytics

Tracking traffic is a crucial part of any successful web venture. Google Analytics is the most popular and widely used analytics tool in the web industry. To track which keywords are generating most traffic, which products are getting most sales, and numerous other such statistics, we’ll integrate Google Analytics into our Magento installation. 

Sign up for Google Analytics if you don’t already have an account. Create a new property, and identify its property tracking number by opening up the relevant property, clicking on the Admin tab at the top, and on the next page clicking on Property Settings.

Google Analytics Property Settings

The next step is to enable eCommerce tracking in your Google Analytics account. For this, again click on the Admin tab, select Ecommerce Settings, and change the status to ON.

Set Google Analytics Ecommerce Settings to On

Now the last step is to enter that tracking number into Magento and to enable tracking. For this purpose we’ll go to System > Configuration > Google API > Google Analytics. Here enter the tracking number, and enable it. Don’t forget to hit Save Config at the end.

Enable Google Analytics in Magento

Coming Up Next

With all these steps completed, we have built a fairly good SEO foundation for our Magento store. 

In the next parts of this series, I’ll guide you further on how to improve your Magento website from an SEO perspective. At the end of the series, I hope you’ll have a fully SEO-optimized Magento website.

Please leave your feedback and questions in the comments!

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.