: How to avoid html tags in Google search summary I am using CKEditor to let people describe their organization with all the styles and fonts. So when it saves in the database its like <
I am using CKEditor to let people describe their organization with all the styles and fonts. So when it saves in the database its like < gets saved as > and rest all you know for the html tags. When I populate this page for public view I convert the > and < to html tags so no issue in displaying too. But the thing noticed recently is when I search the same profile in google I can see <strong> <p> such kind of tags their. Searched Google and Stack Overflow to solve the same but didn't help. Is their any feasible solution?
Sample example of how content from CKEditor stores in table is <p>
Privacy Policy</p> is this. I convert this on web page at load time to html tags so that people see the style and fonts what they wanted. But the Google search summary shows html tags(unwanted). The link for sample view of problem
More posts by @Sherry384
1 Comments
Sorted by latest first Latest Oldest Best
If you don't use <meta name="description"> you need to add this to your html page <head></head>.
I use two PHP function for my content description before adding content to the <meta name="description"> I use htmlspecialchars_decode()for skipping html characters, for more information about this function click here.
Use strip_tags() for skipping html tags, for more information about this function click here
In the end result in this case is
$noramlText = htmlspecialchars_decode(strip_tags($htmlText), ENT_COMPAT);
<meta name="description" content="<?php echo $normalText; ?>">
I'm sorry for bad English
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.