SEO Tip - Changing Magento Product Review Page Titles
Out of the box, Magento doesn't set a page title for individual product review pages. This results in a missed SEO opportunity and many duplicate titles.
Here is a quick way to set the page title in the following format:
(Product Name) Review - (Review Title)In order to do this, open up the following file:
app/code/core/Mage/Review/Block/View.phpAdd in the following code:
/** * Set Page title */ protected function _prepareLayout() { $headBlock = $this->getLayout()->getBlock('head'); if ($headBlock) { if ($product = $this->getProductData()) { $title[] = $product->getName() . ' Review'; } if ($review = $this->getReviewData()) { $title[] = $review->getTitle(); } $headBlock->setTitle($title); } return parent::_prepareLayout(); }
If you do not want to modify core files, copy this file to:
app/code/local/Mage/Review/Block/View.phpThis has been tested and confirmed to work in Magento 1.3, 1.4.*, 1.5.0.1, 1.5.1.0
The Magento SEO Product Review URLs Extension by Iceberg Commerce has SEO Friendly URLs for all product review pages in addition to the SEO Friendly Page titles for product reviews that are outlined in this blog.
Comments
09 11 2010 at 09:15 AM
Hey King, You don’t need the extension to use the code posted in the blog post.
What version of magento are you running?
06 01 2011 at 03:23 AM
Very useful. It is working perfectly..
Thanks…....
06 01 2011 at 03:30 AM
i use this code in magento 1.3.1
It’s working fine…......
25 01 2011 at 01:20 PM
Many thanks, handy tip indeed.
25 03 2011 at 01:42 AM
Working good
22 07 2011 at 09:43 PM
Does this fix work with Magento Enterprise 1.1?
26 07 2011 at 01:38 PM
Hi David,
Yes this change will work with Magento Enterprise.
02 11 2011 at 04:03 AM
Thanks for sharing this information and resources its really help full for me with the help of this we can improve our magento working.
11 01 2013 at 08:25 AM
did not work for me in Mage EE



09 11 2010 at 08:59 AM
Hi, thanks for posting this tip. It didnt work for me though. Do I need the extension?