Home > Magento Tutorials > Magento – SEO Title Gaps

Magento – SEO Title Gaps

Posted on: 20th Nov 2009 By: Adam Moss No Comments

An inconvenient revelation relating to Magento and it’s SEO credentials became apparent recently – something so small and potentially insignificant. But it makes you wonder why such talented coders would do such a thing in the first place – in fact it’s almost on par with forgetting to put a send button on the newsletter function.

I’m talking about the site’s <title> tags. By default they are set with gaps between the tags and the words, which may not be catastrophic but makes you wonder why it’s a problem in the first place. Your default title tags will look like this:

 <title> Creare Demo Store </title>

To ‘close the gaps’ as it were, you need to dig deep into the core scripts: app>code>core>mage>page>block>html>head.php

On line 206 and 207 there’s a function called setTitle which looks like this:

  public function setTitle($title)
    {
$this->_data['title'] = Mage::getStoreConfig(‘design/head/title_prefix’).‘ ‘.$title
.‘ ‘.Mage::getStoreConfig(‘design/head/title_suffix’);
return $this;
}

There are two apostrophes  with a space in them (highlighted in red). Simply get in there and delete that space.

Job’s -a-guddun.

Post A Comment

Your comments:
Enclose code snippets within the appropriate tags: [php][/php]   [js][/js]   [xml][/xml]   [css][/css]   [html][/html]
E.g: [php]<?php echo "hello world"; ?>[/php]

Search Blog

Archives

For the record...

Views & opinions in this blog are those of the individual and do not necessarily reflect those of E-commerce Web Design or the Creare Group.