3

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

3

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'));
    }
1
  • In my case $this->_data['title'] is empty..Do you know why? Should i set titles or will it get CMS page name as title? Jan 4 '17 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.