My meta description for all my products looks something like this:

meta name="description" content="<li>免費附贈專用腳踏幫浦一支</li>

Why is it including the <li> tags? When I enter the products via admin console, I manually type it in in HTML format. But I didn't expect for it to appear in the meta description.

I certainly hope this doesn't show up in search engine listings.

AND, when I share to a social network, even the tags are being shared too.

Anybody know why this is happening?

2 Answers 2


I want to add a few informations.

The meta description is set here:

$description = $product->getMetaDescription();
if ($description) {
    $headBlock->setDescription( ($description) );
} else {
    $headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255));

Therefore if you don't have a meta description, the description is used instead. And (at least in it is nearly echoed "as it is":

<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />

So to solve your problem, I think the easiest is, if you add a meta description. Or you can change the template to strip the tags.


The meta-description (and meta-keywords) values are not processed before displayed in the page. Anything you enter there will be shown "as it is".
On the other hand, I see no reason as to why html tags should entered in the "meta" fields.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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