Copy this file
/app/code/core/Mage/Catalog/Block/Product/View.php
in this folder (create it before!)
app/code/local/Mage/Catalog/Block/Product/View.php
Now find this code (line 67 in Magento 1.9.1.0)
$description = $product->getMetaDescription(); if ($description) { $headBlock->setDescription( ($description) ); } else { $headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255)); }
and edit it as
$description = $product->getMetaDescription(); if ($description) { $headBlock->setDescription( ($description) ); } else { $strippeddesc = html_entity_decode(strip_tags($product->getDescription())); $headBlock->setDescription(Mage::helper('core/string')->substr($strippeddesc, 0, 255)); }
I added $ strippeddesc with product description content, cleaned and correctly decoded.
Now we have some great metadata on google; -)
source share