1. Home
  2. Prices
  3. Guided Tour
  4. New Shop
  5. Shop Review
  6. Ecommerce Marketing
  7. Ecommerce TV
  8. Magento Developers
  9. Portfolio
  10. Blog
  11. Contact

Posts Tagged ‘Magento SEO’

Generating Your Magento XML Sitemap

Posted on: 16th Jul 2010 By: Robert Kent 2 Comments

This post will form a part of a triangle of posts that I have written in order to explain the processes by which you can provide Google with an up to date dynamic sitemap that is optimised for your magento website.

This post will be about generating your Google Sitemap from the Magento admin section, Making sure that the XML file is in place on the root of your server, and double checking the contents of that sitemap.

The other two posts in this series which you should read are:

  1. Setting up a Cron Job in Plesk
  2. Index Your Magento Pages

Once you have read those two posts and this one – you should have a good understanding and grasp of how beneficial automatic xml sitemap generation is for a Magento website.

Creating your XML Sitemap

To create your XML sitemap then, first of all go to catalog>google sitemap. Click on Add Sitemap at the top. You should see something like the following:

You should enter sitemap.xml as your filename and also / as the path for the file to be generated. This will write the file to the root of your magento website. Click save & generate.

If you recieve an error what I suggest is checking that no existing sitemap.xml is currently present. When you generate your sitemap you can now schedule its automatic creation. To do this go to system>configuation>google sitemap.

Set the options for priority as per the Index Your Magento Pages post and for the generation settings set it up so that Obviously set the time however you want it – NOTE that the sitemap will probably not be generated at exactly 9:10am. It will be generated the next time a Cron Job is ran after that time has elapsed.

To set up your cron job using pleask please see my previous post Setting up a Cron Job in Plesk.

Thank you for visiting e-commerce web design and thanks for visiting our magento blog, proud home of the magento fox!

Magento SEO: Index your pages

Posted on: 13th Jul 2010 By: Robert Kent 3 Comments

When it comes to optimising your brand spanking new magento site you may want to think about things like googles webmaster tools and analytics.

Webmaster tools keeps track of the number of pages that have been indexed on your website (the number of pages that google has at its disposal to perform searches on) as well as keeping track of all crawl errors and managing your sitemaps.

If you have read my other post “Setting Up A Cron Job for Magento” you will know that magento has its own automated protocols for generating sitemaps and scheduling other important tasks.

It is always beneficial to generate your sitemap often to compensate for new pages on your website – google will then download and start crawling the extra pages on that sitemap.

However google indexes pages based on their priority. The priority of a page is defined in the XML sitemap and looks a little something like this:

<url>

<loc>http://www.mystore.co.uk/myproduct.html</loc>

<lastmod>2010-07-13</lastmod>

<changefreq>daily</changefreq>

<priority>0.8</priority>

</url>

This is all very familiar to anyone who knows XML and is all well and good in the grand scheme of things.

The problem with the magento generated sitemap is that the default priorities that are set for the different elements (Products, Categories, CMS pages) are not in the best order for the best SEO benefit.

What I expect to be the best method of SEO is to have the categories and CMS pages indexed first (remember priority = position in queue to be indexed). With the categories and CMS pages indexed first (many of which will be optimised pages) then traffic will start flooding to the site. Once this is done then the focus of the priority can shift back to the products. Try changing the priority in system>configuration>google sitemap of your different sections to the ones shown below (categories = 0.8, products = 0.8, CMS = 1.0) This way you should find that your pages with the keywords get indexed faster.

The reason why this is important is because imagine if you had 1000 products ready to go and 5 pages to optimise from. Google will perhaps index 5 of your pages a day – this means google will take 200 days to get round to your optimised CMS pages!

This is a general figure by the way – google does sometimes index outside of its priority but in the case of magento I believe this to be a major floor and one that I have seen delay a sites optimisation by several months.

Thanks for checking out our magento blog, sponsored by the magento fox at ecommerce website design!

Categories: Magento Tips Tags: ,

Making Links Local in Magento

Posted on: 16th Jun 2010 By: Luci Smethurst 3 Comments

One of the lovely built-in issues with Magento is that all the links it generates are external – ie it will always preface the link with the domain, like this: http://www.domain.co.uk/category.html. This is a Bad Thing in terms of SEO – and what’s the point of having a brilliant e-commerce web design if the search engines don’t like it? Don’t worry, a solution can be found right here on the Magento blog. Read on, avid readers!

The solution is actually relatively simple – just add a string replace onto any links you would like to be local, for example on the getChildHtml include in your head.phtml file:

echo str_replace("http://www.domain.co.uk/", "/", $this->getChildHtml());

- replace www.domain.co.uk with your domain name and it will replace all instances of it with a /.

However, all is not well in the getCssJsHtml include. This little function is the reason why it’s not as simple as it could be – it pulls in all the CSS, JS and HTML tags that you see in the tag, which sounds brilliant in theory, but if you have enabled canonical links it’s actually a Bad Thing.

Why, you ask?

Because the wonderful string replace tags we used earlier will find all instances of your domain name (for example www.e-commercewebdesign.co.uk) and replace them with a / – including in the generated canonical link tags.

All is not lost however. We’ll just separate the likes of the canonical links from the Css, Js and other Html tags… like two naughty children in a playground.

  • Go to your getCssJsHtml() function
  • Find the section helpfully labelled “other stuff” (about line 211), copy the code and delete it from the function:
	// other stuff
            if (!empty($items['other'])) {
                $html .= $this->_prepareOtherHtmlHeadElements($items['other']) . "\n";
            }

            if (!empty($if)) {
                $html .= '<!--[endif]-->'."\n";
            }
  • Create a new function, I’ve called my getOtherHeadLinks()
  • Paste in the code you’ve just copied
  • Now, that code isn’t enough on it’s own, we also need to tell all the whither-to’s and why-fors, so we add some more code above the “other stuff” so that you end up with the function below, and hey presto, you’ve got a working function and separate canonical links!
  public function getOtherHeadLinks()
    {
        // separate items by types
        $lines  = array();
        foreach ($this->_data['items'] as $item) {
            if (!is_null($item['cond']) && !$this->getData($item['cond']) || !isset($item['name'])) {
                continue;
            }
            $if     = !empty($item['if']) ? $item['if'] : '';
            $params = !empty($item['params']) ? $item['params'] : '';
            switch ($item['type']) {
                default:
                    $this->_separateOtherHtmlHeadElements($lines, $if, $item['type'], $params, $item['name'], $item);
                    break;
            }
        }

        // prepare HTML
           $html   = '';
        foreach ($lines as $if => $items) {
            if (empty($items)) {
                continue;
            }
            if (!empty($if)) {
                $html .= '<!-- [if '.$if.']-->'."\n";
            }

			// other stuff
            if (!empty($items['other'])) {
                $html .= $this->_prepareOtherHtmlHeadElements($items['other']) . "\n";
            }

            if (!empty($if)) {
                $html .= '<!--[endif]-->'."\n";
            }

        }
        return $html;
    }