Search result showing code not content

Using the search feature results in some pages showing short code instead of content.
Here is an example, https://www.unitedfaithchurch.org/?s=prayer

Hello @clefler,

Thanks for writing to us.

The search results display excerpts. The excerpts only display the first 55 words in your post/page contents. If you used Cornerstone in building the page, the Cornerstone formatting shortcodes will be displayed.

To get rid of this issue, you will need to insert manual excerpts for your posts and pages. To know more about how you can make use of the Manual Excerpts, please check this out:
https://codex.wordpress.org/Excerpt#How_to_add_excerpts_to_posts

And since pages, does not have excerpts by default, you will have to hack WordPress to be able to insert a page excerpt. Please check out this link to guide you to do it:

If it doesn’t work for you, please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts

Thanks

Thank you for the quick response.
I don’t understand because there are lots of pages that show up just fine in the search results and they have been built using “Edit with Pro”.

Hello @clefler,

There seems to be a code encryption happening in the excerpt.

{%%{children}%%} {%%{children}%%} {%%{children}%%} {%%{children}%%} {%%{base64content PGEgIGNsYXNzPSJ4LWJ0biB4LWJ0bi1mbGF0IHgtYnRuLXJvdW5kZWQgeC1idG4tbGFyZ2UiIHN0eWxlPSJmbG9hdDpsZWZ0O21hcmdpbi1yaWdodDoyMHB4O21hcmdpbi1ib3R0b206MjBweDsiIGhyZWY9Imh0dHA6Ly9pbmZvcm1hdGlvbmF0aW9uYmxvZy5jb20vdW5pdGVkLWZhaXRoLWNodXJjaC8iICAgICBkYXRhLW9wdGlvbnM9InRodW1ibmFpbDogJyciPjxpICBjbGFzcz0ieC1pY29uIG12biBtbG4gbXJzIHgtaWNvbi1maWxlLXRleHQtbyIgZGF0YS14LWljb24tbz0iJiN4ZjE1YzsiIGFyaWEtaGlkZGVuPSJ0cnVlIj48L2k+UHJheWVyIEFydGljbGU8L2E+Cg== }%%}

Kindly provide us access to your site so that we can check your settings. Please create a secure note with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role

To know how to create a secure note, please check this out: How The Forum Works

Best Regards.

ok thank you…

Hello @clefler,

The search results page is displaying pages. By default, pages have no excerpts and this is why in the results page, some page has no excerpts or has some random excerpts. You may need to turn ON the excerpt and insert a custom page excerpt so that there will be something to display in the search results page. Kindly check out this threads instead:

Hope this helps. Kindly let us know how it goes.

Hi I’m sorry I still don’t understand why some pages show up properly and some show up with short code.
None of the pages on my site have an excerpt field.
Why would I need a plugin to show search excerpts on some pages but not others?

Hi @clefler,

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.

Hopefully, it will solve your issue.

Thanks

ok thank you for the explanation
if I do that will pages that are producing excerpts properly need to have excerpts manually added now?

Hi @clefler,

The code will add an option for an excerpt in the pages, and you can add the content manually if you want.

Thanks

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