the_excerpt displaying code inside style tag

I created a custom visual composer element where I included a style tag on it to use the chosen color to create hover effect.
And this code is now displaying in the the_excerpt in the search result page when one of the results is a page and has the custom element on it.
https://www.beproductive.ie/?s=learn

See the privacy policy on for example.

Is there a way to make the_excerpt ignorer the tag?

Read more here:: the_excerpt displaying code inside style tag

Leave a Reply

Your email address will not be published. Required fields are marked *