If your e-commerce store is on Magento, then you probably already know it’s arguably the most powerful, most customizable shopping cart platform out there. The trade-off, of course, is that Magento is not very intuitive, and while it has the potential for strong technical SEO, its out-of-the-box settings are far from optimal. Here we’ll cover a few quick things you can quickly implement today on your Magento e-commerce website to boost your store’s SEO. Note that these recommendations apply to both Magento 1.X and 2.X installations.
1. Canonical Tags
Canonical tags tell search engines what the original, representative page is supposed to be for any given piece(s) of content. It’s imperative that you use canonical tags to prevent the duplicate content situations that Magento’s default settings are prone to creating. Out of the box, Magento has canonical tags disabled and also has many different URL parameters – most for specifying and sorting categories – that are crawled and potentially indexed. This creates thousands of possible permutations of similar or even identical pages – a duplicate content nightmare! Another common problem is that Magento automatically generates multiple URL’s for a single product based on which categories that product resides in. A canonical tag tells the crawler that for any set of similar pages, the specified canonical URL is the single representative page for that content. Thankfully, enabling canonical tags for categories and products in Magento couldn’t be easier. Simply go to System > Configuration > Catalog > Search Engine Optimizations and set both Use Canonical Link Meta Tag for Categories and Use Canonical Link Meta Tag for Products to “Yes”. Then save the configuration.
Bonus – How to manually add a canonical URL tag to any page:
The above setting does not apply to CMS pages, and there may be instances where you want a category or product to canonicalize to a different URL, in which case you’ll need to define the tag manually by going to the Design tab on any page and entering the following in the Layout Update XML section, replacing “YOUR URL” with the URL on your website:
<reference name=”head”> <action method=”addLinkRel”> <rel>canonical</rel> <href>YOUR URL</href> </action> </reference>
Save the page, and go check the head section in the source code for the page you just edited (note that you may have to clear the Magento cache and/or your browser cache to see the changes reflected) and look for a snippet that looks like this:
<link rel="canonical" href="YOUR URL" />
A website’s robots.txt file contains directives that tell web crawlers which URL’s they should not access. Again, this is useful for safeguarding against all the potential duplicate content issues described above, as well as blocking things like Magento system files and checkout pages that could potentially be crawled and indexed. You can also set crawl delays in the robots.txt file if necessary. Magento’s default robots.txt file is empty, which is not ideal.
Here is the robots.txt file we wrote up for our client frogg toggs®, which is also shown below. Note that some of your category URL parameters will not be the same as the ones we’ve used. We aimed to block crawlers from Magento system directories and files, in-site search results pages, customer account pages, any URL’s with session ID’s appended, URL’s with the aforementioned query parameters used for category sorting and filtering, and any default non-SEO-friendly URL patterns. With the extensive product catalog that frogg toggs® has, these directives help eliminate tens of thousands of pages from being crawled that would be seen as duplicate content, and prevent sensitive pages and files from being indexed in search engines.
User-agent: * Crawl-delay: 10 # Directories Disallow: /app/ Disallow: /bin/ Disallow: /dev/ Disallow: /lib/ Disallow: /phpserver/ Disallow: /setup/ Disallow: /update/ Disallow: /var/ Disallow: /vendor/ # Paths Disallow: /*index.php Disallow: /catalog/product_compare/ Disallow: /catalog/category/view/ Disallow: /catalog/product/view/ Disallow: /catalogsearch/ Disallow: /catalogsearch/advanced/ Disallow: /control/ Disallow: /contacts/ Disallow: /customer/ Disallow: /customize/ Disallow: /newsletter/ Disallow: /order-status/ Disallow: /sendfriend/ Disallow: /wishlist/ # Files Disallow: /composer.json Disallow: /composer.lock Disallow: /CONTRIBUTING.md Disallow: /CONTRIBUTOR_LICENSE_AGREEMENT.html Disallow: /COPYING.txt Disallow: /Gruntfile.js Disallow: /LICENSE.txt Disallow: /LICENSE_AFL.txt Disallow: /nginx.conf.sample Disallow: /package.json Disallow: /php.ini.sample Disallow: /RELEASE_NOTES.txt # Session IDs Disallow: /*.php$ Disallow: /*?SID= # Sorted and filtered categories Disallow: /*?dir Disallow: /*?limit Disallow: /*?mode Disallow: /*?lifestyle Disallow: /*?order Disallow: /*?series Disallow: /*?price Disallow: /*?q Disallow: /*?size Disallow: /*?color Disallow: /*?trueweight # CVS, SVN directory and dump files Disallow: /*.CVS Disallow: /*.Zip$ Disallow: /*.Svn$ Disallow: /*.Idea$ Disallow: /*.Sql$ Disallow: /*.Tgz$
3. Disable category paths for product URL’s
By default, Magento includes categories in product URL’s. This becomes a problem when a single product resides in multiple categories. For example, if our product “Widget” is in both the “Blue” category and the “Red” category, the system will generate 2 different URL’s that look something like this:
Both of those URL’s would resolve to the same page, which is an example of duplicate content. To preemptively prevent this, we want the system to strip the category from the product URL before it’s generated, resulting in a URL that looks like:
To do this, simply go to System > Configuration > Catalog > Search Engine Optimizations and set Use Categories Path for Product URLs to “No”.
This post originally appeared on The Brandon Agency‘s blog here. Go check it out.
Leave a Reply