develop branch./joust-duffle-bag.html.View source.
The meta description tag should not contain HTML.
The meta description tag contains unescaped HTML, which results in a broken tag:

Is this still happening in M2.1? I had to create a temporary workaround by writing a plugin that wraps itself around getData:
/**
* Temporary fix until Magento no longer allows HTML in the Meta Description field
* @param \Magento\Catalog\Model\Product $product
* @param \Closure $proceed
* @param array $arguments
* @return mixed
*/
public function aroundGetData(\Magento\Catalog\Model\Product $product, \Closure $proceed, $key = '', $index = null)
{
$returnValue = $proceed($key, $index);
if ($key === 'meta_description') {
$returnValue = strip_tags($returnValue);
}
return $returnValue;
}
I couldn't use afterGetMetaDescription, because it's not getMetaDescription() that is used, but getData('meta_description').
On a sidenote: can anyone confirm that this still is broken in M2.1?
Issue is related to #4411.
Thank you for your submission. The Magento 2 GitHub repository is used to capture code and documentation issues. According Magento documentation - this is not a bug. Please refer to the Community Forums or the Magento Stack Exchange site for technical questions.
Hi @VasylShvorak, thank you for joining us, and for your timely and expanded response (on behalf of Magento. Inc., I assume?)
The Magento 2 GitHub repository is used to capture code and documentation issues.
Yep, it's a code issue. The code is buggy, and it's an issue.
According Magento documentation - this is not a bug.
Oh wow, do you guys happen to have some _special_ definition of the word "bug"?
Would you mind sharing a link to the said documentation, so that other people could also learn the criteria used (for future reference)?
Please refer to the Community Forums or the Magento Stack Exchange site for technical questions.
If this was a question, there would be a question mark at the end. Looks like the following: ?.
There isn't one, which means: there is no question. It's certainly a bug.
P.S. Guys, please get your stuff together. This is getting rather embarrassing.
@thdoan thank you for your report one more time.
Unfortunately after some discussion this issue was agreed to be not a bug as we do not support such functionality.
However you can submit it as an improvement to Magento 2 Feature Requests and Improvements forum (see details here).
If you need help with this issue please refer to the Community Forums or the Magento Stack Exchange site. As GitHub issue tracker is intended for technical issues only.
Unfortunately after some discussion this issue was agreed to be not a bug as we do not support such functionality.
Hi @veloraven, could you please clarify that a bit further? I'm confused.
Are you saying that "html tags being output into the meta tag" is intended behavior?
Or are you saying that "rendering the meta tag" functionality (which Magento seems to provide) is not guaranteed to be working properly?
@veloraven if unescaped HTML is allowed in meta description, then Magento has some fundamental problems. Please add a command to strip all HTML codes from meta description.
Hi @veloraven, hi @magento-team, hi @maksek, hi whoever else can take a look at this.
I get that you guys don't have enough resources and don't feel like working on small stuff like this one at the time. That's okay.
But could you at least be honest about that, acknowledge the issue and declare that it has low priority by labeling it as up for grabs (maybe even with the very same sentiment of "we do not support such functionality") ?
That way, it just might get fixed by someone from community, eventually.
Otherwise it'll probably get lost and forgotten, and then reported again, and so goes on the circle of the bug's life...