Magento – SEO Title Gaps
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.
