Page Description not correctly displayed while search

Hello, when I am searching certain page on my website the description of the page is not displayed correctly. How can I fix it?

Hello Jamie,

Thanks for writing to us.

The search results display excerpts. And WordPress generates plain text when displaying the excerpt, it will remove all shortcodes and HTML. But some could bypass if it contains malformed content, or other 3rd party plugins are appending some content.

The solution is adding text excerpt manually into your page(s).
And since pages, do not have excerpts by default, you will have to add custom codes into WordPress to be able to insert a page excerpt.
Please go through this link to guide you to do it:

Please follow the steps:

  1. Add this line to your child theme’s functions.php which adds the excerpt option to your pages.add_post_type_support( ‘page’, ‘excerpt’ );
  2. Edit your page or post and scroll to the very top and click Screen Options, make sure the Excerpt toggled is on
    Scroll down and find the Excerpt meta box section and there, add your text excerpt.

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.