I checked the HTML validator. But, the message is the following.
Quote " in attribute name. Probable cause: Matching quote missing somewhere earlier.
The meta description is automatic from the content. So, if the content includes the quotation, it is also included in meta descrption. I would like to strip the quotation.
Currently, I inserted the code in header.php as below.
$description = strip_shortcodes($description);
$description = wp_strip_all_tags($description);
What should I add?
I checked the HTML validator. But, the message is the following.
Quote " in attribute name. Probable cause: Matching quote missing somewhere earlier.
The meta description is automatic from the content. So, if the content includes the quotation, it is also included in meta descrption. I would like to strip the quotation.
Currently, I inserted the code in header.php as below.
$description = strip_shortcodes($description);
$description = wp_strip_all_tags($description);
What should I add?
Share Improve this question asked Oct 19, 2018 at 5:18 YoosYoos 13 bronze badges2 Answers
Reset to default 0Try to use Yoast SEO: https://it.wordpress/plugins/wordpress-seo/
It's the best plugin for SEO in WP and should be strips all "dangerous" chars
Probably, it works for HTML5 Validator.
$description = str_replace(array("\r\n","\r","\n"," ",'"',"'"),'',$description);
$description = strip_shortcodes($description);
$description = wp_strip_all_tags($description);
First quotation is removed, but second one is not removed, though.