A guide to doing SEO on Magento websites
Paul Rogers / March 19, 2012

Magento is a hugely popular, open source ecommerce platform that powers well over 100,000 transactional websites across the world.

A number of our SEO clients have Magento websites, which has required us to deal with a host of issues over the last few years. Here are some of the key areas that I would recommend addressing:

Preventing filter pages from being indexed: 

One of the most common SEO issues with Magento is dynamic filter pages being indexed by search engines. These filter pages are ultimately duplicate versions of category pages (with different products) with a dynamic query string attached to the end of the URL. We've created a Magento SEO plugin which can help eliminate this issue, but I'll talk about this in more detail later on in the post.

Here is an example from the Harvey Nichols website (one of my favourite Magento websites). 

This is just an example of one page of the website - there will be thousands of URL’s like these indexed for this website.

Preventing this from happening:

When launching new websites, we prefer to assign rules to add nonidex,follow meta robots tags to pages with set parameters – this tells the main search engines to continue crawling the site but not to index the page. You should also add a nofollow attribute to links to filter pages, for added safety.

Alternative methods:

You could choose to rely solely on canonical tags (you should have these either way), which are designed to tell search engines if dynamic pages are replicas of static pages -although I’ve had issues in the past with search engines indexing the pages anyway.

Assigning rules to parameters in Google Webmaster Tools appears to have become more effective over the last few months, so this could be another option (I've not tried it on a new website recently). I did try this around 18 months ago but didn’t have much success.

Our new Magento plugin also helps to prevent dynamic pages from being indexed by allowing you to set meta robots tags for your chosen types of pages on your website – you can find out more here. We will also be adding lots of new features to this plugin (such as rel=next and prev and sitemap options).

Turning dynamic filter pages into static category pages:

Last year I turned some of the filter pages on a client’s website into static category pages. We created lots of new pages, optimised them and added content and we were delighted when we got a lot of traffic from keywords that other websites weren’t really targeting. The most important thing to remember when doing this is that it can (if done incorrectly) impact the usability of the website.

If you’re replacing existing filter pages, you can simply 301 redirect (using a rewrite rule) the previous dynamic URL’s to the new static pages.

Removing pages from the index:

If you’re working on an existing website that has dynamic pages in the index, I would personally recommend adding a noindex, follow meta robots tag and submitting removal requests in Webmaster Tools. In the past, I’ve found that once you start submitting removal requests, the search engines are quicker to remove the other pages.

Just adding meta robots tags to these pages will work, but it could take a long time before search engines take note. I’ve always had good results from adding the noindex,follow meta robots tags and manually submitting removal requests in Google Webmaster Tools. I’ve never had to do too many before other pages started to drop out. 

Just as with a new website, you could choose to use the canonical tag and/or set parameters in Google Webmaster Tools, but I’ve found that noindexing the pages and submitting removal requests is more effective and quicker.

Note: I would recommend checking to see if your filter pages have generated many links, as this could make the canonical tag a more attractive option.

Preventing search pages from being indexed:

Another common SEO issue with Magento comes from search engines choosing to index search pages. In the same way as with filter pages, I would recommend using robots.txt or meta robots tags to tell search engines not to index them.

Once you’ve done this you can submit a removal request for the entire directory in Google Webmaster Tools and the pages will be gone within 24 hours.

Dealing with automatic URL rewrite rules: 

If you do a ‘site:’ search in Google on a Magento website, chances are you will find category page URL’s ending with -1 or -2. This is a result of Magento’s automatic redirect feature, which prevents you from reusing the same URL, even if you’ve only changed it accidentally. If you truncate the core_url_rewrite_table then Magento will regenerate all the URL's, removing all of the -1's and -2's. If they've been indexed, you can then create a new rewrite rule to 301 redirect them to the clean version of the URLs.

This is certainly something to keep an eye on.

Using SEO-friendly URL’s:

In order to escape the ‘/index.php?xxxxx’ and have clean, SEO-friendly URL’s, simply turn on URL rewrites in the ‘search engine optimisation’ section of configuration in the back-end.

Using top-level product URL's:

You can choose whether or not to use category paths within product URLs within the 'search engine optimisation' section of the 'catalog' section in the back-end config. I would strongly recommend setting this to 'no' as using category paths for products will leave you with very long URL's and potential duplicate products if they feature in multiple categories.

Having all of your products on the top-level of your site will make them easier to read and help to keep the structure of your site clean.

Adding the canonical tag to products and categories:

I would strongly recommend setting the option of having canonical tags on product and category pages to yes. These options can be found in the 'search engine optimisation' tab of the 'catalog' section in the back-end admin area.

Addressing page load performance:

Another common issue with Magento is the speed at which pages load, mainly due to the size of the CMS files. Generally, Magento sites are pretty slow, but the speed can be improved! By addressing the usual areas (images, CSS etc), installing a caching plugin and/or digging into your code, you can make your website much faster.

A couple of our Magento clients' websites are also hosted on Amazon EC2 servers, which also helps to speed up load time (read our 'hosting Magento on the cloud' post).

You can find out more by reading this post on speeding up Magento

Ensuring that you’re using 301 redirects:

Default Magento installations are set to use 302 redirects when forwarding an old URL to a new one. As the majority of people reading this post will know, a 302 redirect doesn’t pass value and is specifically designed for temporary page redirects.

So, unless you’re looking to temporarily forward visitors to a new page, you should be using 301 redirects as they pass 95-99% of the value from the existing page to the new one.

Setting h1 headings:

By default, a new Magento installation will set the logo as the h1 header, meaning that this will be your h1 on every page or you will have multiple h1’s. 

Getting rid of unwanted login and cart pages:

It’s common for URL’s like ‘/customer/account/login/’ or ‘/enable-cookies’ to be indexed by search engines – you should either disallow any unwanted directories in robots.txt or add a noindex,follow meta robots tag.

In the past I’ve got a lot from this post from Joost De Valk, it’s the most comprehensive Magento SEO guide I've found and it's definitely worth reading.

If you have any questions about Magento SEO or feel I've missed anything, please feel free to leave a comment below. You can also follow me on Twitter or Google Plus.

You can find out more about the SEO services we provide for Magento retailers here, or you can download our SEOpack extension for Magento here.