Search results showing short codes, via Relevanssi

Hi,

My search results on this site are returning shortcodes: https://woottonwebsites.com/?s=video

Results: https://prntscr.com/hdu529

I have set “expand shortcodes” in the settings for Relevanssi so I’m puzzled, as this works fine on razor-risk.com which I also built.

Bill.

1 Like

Hello Bill,

Thanks for asking. :slight_smile:

Search results are working fone on my end and I don’t see any shortcodes up there. Please see screenshot. https://screencast.com/t/nIZHpSc2Rcbs

Thanks.

Hello @prasant,

I disabled Relevanssi for now - I can switch it back on again, or give you an Admin login to experiment?

Thanks, Bill.

Hello Bill,

The search results displays excerpts. The excerpts only displays the first 55 words in your post/page contents. If you used Cornerstone in building the page, the Cornerstone formatting shortcodes will be displayed instead. To prevents from happening, 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 an 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:

Hope this helps.

The Relevanssi plugin indexes the text of each post and page completely in addition to excerpts. I am going to contact the developer and see what they say, as this works fine on www.razor-risk.com - try doing a search there - yet doesn’t work on Capra Marketing (it displays shortcodes).

OK here’s the answer:

  • A site made with WP 4.9.1 and Pro 1.2.7 gives good search results for pages made with Pro 1.1.1
  • The same site with a brand new page made with Pro 1.2.7. gives the bad search results

Test it for yourself here: https://capra-staging.com

  • Search for newland - you get nicely formatted results
  • Search for V2 text - the results display short codes

What is the underlying difference which is causing this ? - it makes Pro and Relevannsi incompatible.

Hi,

I am getting redirected to the login page trying to access that page.

Can you provide us your wordpress admin login in Secure note.

Thanks

Sorry - the site was private, I’ve made it public. I’ll provide an admin login too

I’m having the exact same problem, whith some of the pages showing strange code on the Search results page.

Hi guys,

You’ll have to add excerpt for those pages. Please do this,

  1. Add this line to your child theme’s functions.php

add_post_type_support( 'page', 'excerpt' );

This is needed for page type since it doesn’t have excerpt by default

  1. Edit your page or post and scroll to very top and click Screen Options, make sure Excerpt is toggled on

  2. Scroll down and find Excerpt meta box section and there, add your text excerpt.

Wordpress generates plain text when displaying excerpt, it will remove all shortcodes and HTML. But some could bypass if it contains malformed content, or other 3rd party plugins is appending some content. The solution is adding text excerpt manually which is provided by Wordpress itself.

Thanks!

SOLVED: the develop of Relevanssi says he will fix this in the next release. The idea above for Excerpts doesn’t get at the heart of the problem, why did Relevanssi work with earlier versions of Pro? What changed in later versions of Pro to cause the shortcodes to be displayed? I guess we may not know, but my advice for anyone reading this on Dec 4th 2017 is to look for a release of Relevanssi after this date.

1 Like

Hi,

Thanks for sharing that.

Have a great day! :slight_smile:

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