Magento 1.9 SEO – Fix Missing Title Tags and Duplicate URLs

magento-1.9seo

It is a Magento store and I see the following in Webmaster tools. How Can I fix missing title tags and duplicate URLs?

enter image description here

Best Answer

1) Duplicate URLs problem.

First, make sure that the issue really exists (sometimes, WMT can just show some old errors). You should find different site URLs and unify them (with or without trailing slash). But note that this is rather a hard task.

You may also add a 301 redirect to .htaccess file, for example:

############################################
## Make 301  to URL with trailing slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteCond %{REQUEST_URI} !(.*)\.(html|shtml|php)$
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301]

And note that this is just an example, and most likely you will have to modify it for your website.

When done, restrict the unneeded pages from registration.

2) To modify your Title, please follow the instructions below:

copy this: /app/code/core/Mage/Page/Block/Html/Head.php to: /app/code/local/Mage/Page/Block/Html/Head.php

and modify from:

public function getTitle()
   {
        if (empty($this->_data['title'])) {
            $this->_data['title'] = $this->getDefaultTitle();
        }
        return htmlspecialchars(html_entity_decode(trim($this->_data['title']), ENT_QUOTES, 'UTF-8'));
    }

to:

public function getTitle()
   {
        if (empty($this->_data['title'])) {
            $this->_data['title'] = $this->getDefaultTitle();
        }      
        ///Added 'RSS Feed | Website Name' for title
        if (Mage::app()->getRequest()->getModuleName() == 'rss') {
            $this->_data['title'] = 'RSS Feed | ' . Mage::app()->getWebsite()->getName();
        }
        ///

return htmlspecialchars(html_entity_decode(trim($this->_data['title']), ENT_QUOTES, 'UTF-8'));
    }