100% Satisfaction Guaranteed. Click here to read why you should by from us.

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.php

Add in the following code:

  1. /**
  2.  * Set Page title
  3.  */
  4. protected function _prepareLayout()
  5. {
  6. $headBlock = $this->getLayout()->getBlock('head');
  7. if ($headBlock)
  8. {
  9. $title = array();
  10. if ($product = $this->getProductData())
  11. {
  12. $title[] = $product->getName() . ' Review';
  13. }
  14.  
  15. if ($review = $this->getReviewData())
  16. {
  17. $title[] = $review->getTitle();
  18. }
  19.  
  20. $title = implode(' - ', $title);
  21. $headBlock->setTitle($title);
  22. }
  23.  
  24. return parent::_prepareLayout();
  25. }

If you do not want to modify core files, copy this file to:

app/code/local/Mage/Review/Block/View.php

This 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.





Page 1 of 1 pages