A guide to doing SEO on Magento websites

Posted by Paul Rogers on 19 March 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

Comments (10)

  • Jim Watson Jim Watson on March 19th, 2012

    Excellent article Paul - I work on a few Magento sites - the SEO pack from Yoast is also a great time saver..

  • Paul Paul on March 19th, 2012

    Thanks mate - I agree, the Yoast plugin is really good too!

  • Luis Luis on March 21st, 2012

    Hi Paul,

    Nice article! I'm a newbie with Magento :).
    I have one question.
    If i have a brand atribute on my site, and i rewrite all the urls, for example: http://www.mydomain.com/shoes/brand/nike instead of http://www.mydomain.com/shoes?brand=18, it will be better to index these urls because they are friendly? Or is better to don't index them because of duplicate content?

  • Paul Paul on March 23rd, 2012

    Hi Luis,

    Changing the URL's wouldn't change that they feature duplicate content, I wouldn't recommend applying this fix.

    We did something similar with one of our clients - our developers automated the process of creating and populating new category pages to replace the filters - we then just redirected the filters and worked alongside a copywriter to get some new content on the pages.

    Now, these pages are ranking really well for some keywords that we weren't previously targeting. I would recommend looking into this method.

  • Andrea Andrea on April 13th, 2012

    Tanks for your great article.
    I noticed that after enabling "Use Web Server Rewrite" the old URLs which have /index.php/ remains accessible.
    It's possible to redirect these URLs, maybe with .htaccess, to prevent duplications?

  • Paul Paul on April 16th, 2012

    Hi Andrea, thanks for your comment.

    Yes, I would recommend writing a rewrite rule that 301's all of the index.php URLs to the correct pages (implement on a stage version of the site first).

    This will also carry the majority of the value (from links) over from the index.php pages to the new pages.



  • Gabriel Gabriel on May 3rd, 2012

    A superb article! Thanks for the insight!

    My only wish is that I had read it before setting up my Magento store about 15 months ago. I indadvertedly set the "use category paths within product URLs" setting to "YES" and now have a ridiculous 923,000 pages indexed by Google. This is extreme for a site with 4000 products and a handful of CMS pages.

    I could easily flick that setting to "No" but am hesitant since the resulting huge reduction in pages indexed may affect our great SERP rankings which are vital to us, to say the least.

    My question is (if you could be so kind) -would you expect your search rankings to be penalised for having made taken such an improvement to your site product URL structure? Or will Google see it as a catastrophic drop from 900,000+ pages to 4,000+ pages and penalise accordingly?

    Many thanks,

  • Paul Paul on May 4th, 2012

    Hi Gabriel,

    I was working on a Magento site a year ago that had a similar issue - I ended up removing thousands of pages and the website's rankings improved a lot.

    I would think that the worst case scenario would be a temporary drop as long as you make sure the existing pages are 301ing to the new top-level URLs.

    These unnecessary pages are also currently eating into your crawl budget.

    I would be happy to take a look at the site if you want to email me at paul {at} gpmd.co.uk.

  • seo services in uk seo services in uk on May 27th, 2012

    Great article Paul - I focus on a few Magento webpage - the Google search System Optimization transportation from Yoast is additionally a great time saver..

  • Stef Stef on July 19th, 2012

    I checked The SeoPack Module and looks very impressive. These are several of the issues I had to deal in the past. This module is very useful. I think I need to replace existing one with this one.

    Thank a lot for this great post!!

Post your comment