Mobile app version of vmapp.org
Login or Join
Sherry384

: 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 <

@Sherry384

Posted in: #GoogleSearch #Html #Javascript #Jquery #Php

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 &gt and rest all you know for the html tags. When I populate this page for public view I convert the &gt and &lt 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 &lt;p&gt;
Privacy Policy&lt;/p&gt; 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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

1 Comments

Sorted by latest first Latest Oldest Best

 

@Candy875

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme