Magento unique titles change on filters pages

magento ecommerce canonical options

Magento title problem

I will post in this page solution to fix problems with non unique titles in Magento. This post is inspired from my previous post about Magento problems with SEO and is described in details on this link Magento ecommerce solution problems.

magento ecommerce solution problems

Magento problem and title change

So, in short these duplicate and wrong titles are present on filters pages urls in all Magento categories. Posted from me solution to change title on this page is quick and not so good, if you need better, you must modify code yourself.

Php code to add unique title on filter page in Magento

In this php code is shown how to add manufacturer title to page title – to make manufacturers page more SEO friendly.

Open Magento’s file: /app/design/frontend/default/{ACTIVE_TEMPLATE_NAME}/template/page/html/head. phtml

Add at top:
$manufacturer_name = '';
$manufacturer_id = empty($_REQUEST['manufacturer']) ? '' : (int) $_REQUEST['manufacturer'];
if ($manufacturer_id) {
$resource = Mage::getSingleton('core/resource');
$manufacturer_name = $resource->getConnection('core_read')->fetchOne('SELECT `value` FROM '.$resource->getTableName('eav_attribute_option_value').' WHERE `option_id` = '.$manufacturer_id.' AND `store_id`={STORE_ID}');
}

Than search for title tag and change it – change code from:
<title><?php echo $this->getTitle() ?></title>

change title to:
<title><?php echo $this->getTitle().$add_to_title; ?></title>

You may also like...