Of course, you can restrict your review pages from indexation. That can be done by removing links to this page and moving the reviews list to the main product pages. This is the way most of users who have a custom theme choose.
However, a better alternative to this 'standard' solution would be changing meta descriptions and meta titles for your reviews page.
Just copy this: /app/code/core/Mage/Page/Block/Html/Head.php
to: /app/code/local/Mage/Page/Block/Html/Head.php
and modify (the example for meta titles and meta description will be the same):
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 'Review for' for title
if ($this->_getCurrentFullActionName() == 'review_product_list') {
$this->_data['title'] = $this->__('Reviews for') . ' ' . $this->_data['title'];
}
///
return htmlspecialchars(html_entity_decode(trim($this->_data['title']), ENT_QUOTES, 'UTF-8'));
}
protected function _getCurrentFullActionName()
{
$controller = Mage::app()->getFrontController();
if(is_object($controller) && is_callable(array($controller, 'getAction'))){
$action = $controller->getAction();
if(is_object($action) && is_callable(array($action, 'getFullActionName'))){
$actionName = $action->getFullActionName();
if($actionName) return $actionName;
}
}
return null;
}
This and other problems, for example, not friendly URLs for review pages or duplicate content in different categories:
http://clients-sherodesigns.com/newstore/review/product/list/id/456/category/17/
http://clients-sherodesigns.com/newstore/review/product/list/id/456/
can be solved by using MageWorx SEO Suite Ultimate - the software will correct all the issues with URLs and duplicate content:
http://clients-sherodesigns.com/newstore/khaki-bowery-chino-pants/reviews
I noticed the same thing when I first generated my sitemap. I ended up making a short extension module and tweaking the sitemap query for products.
The class that needs to be extended:
Magento\Sitemap\Model\ResourceModel\Catalog\Product
The function that needs to be overridden:
public function getCollection($storeId)
Change the parameter in the joinLeft
of the query from:
'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
To the following:
'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1 AND url_rewrite.metadata is null'
This works for me. I'm obviously not doing a check for the canonical configuration setting and just scoping on the meta-data field in the query. This HAS NOT been thoroughly tested, so I make no promises that this won't exclude products for some reason.
I hope this helps. Maybe there will be an official patch for this later, but for now this is my solution.
Best Answer
You could create a custom product attribute for this.
Whether a canonical tag should be rendered on a catalog product page is determined in Mage_Catalog_Block_Product_View around the line with
$headBlock->addLinkRel('canonical', $product->getUrlModel()->getUrl($product, $params));
.You could adjust this code that the default canonical is overwritten when the product attribute is filled out in the admin. If not, then it will fallback to the old behaviour.
The proper way to enhance this code is by extending this block from within a custom module.