The SEO Mantra: Tips, Tricks & Musings

My Experience of SEO, Especially in Indian context…

Archive for the 'META tags' Category


Removing META name=title tag in Symfony for SEO

Posted by sumedhinamdar on July 20, 2008

A little technical tip for people who use Symfony framework…

The <?php include_metas() ?> call in Symfony includes META tags…there is a tag <META name=”title” in it…which is not the real Title tag…

From SEO perspective, this META tag might be dangerous, and is certainly useless…Google might think of your site as it’s repeating keywords too much…though I am not sure about this…may be I’ll post an update on this based on my experience…

There is no straightforward way to remove it…but I found a great way with the help of some great hackers on Symfony google group…

Basically, you need to write a class overriding the default sfWebResponse class…and unset the META name=title tag in it…like this:

class myWebResponse extends sfWebResponse
{
public function getMetas()
{
$meta_tags = $this->getParameterHolder()->getAll(’helper/asset/auto/meta’);
//find mata title tag and if find then reset to blank.
if (array_key_exists(’title’, $meta_tags))
{
unset($meta_tags['title']);
}
return $meta_tags;
}
}?>

Now, you just need to modify your factories.yml file to use this class instead of default sfWebResponse class, and you are done! :)

I thought this problem would be faced by other people…so posted quickly… :)

Posted in META tags | Tagged: , , | 1 Comment »