I love Relevanssi… I think it provides amazing results. a HUGE improvement over the default WP search engine. But there is one problem: It is indexing the related posts provided by the YARPP plugin at the end of each post, which causes some false positives.
I would like to exclude the DIV class containing the list of related posts, which is:
Is there any way to do something like that?
How are those related posts added to the post? Is it a shortcode?
Hi Mikko, they are added to all posts sitewide via the YARPP plugin, not a shortcode in the particular post.
I don’t think YARPP adds these links inside the_content() but rather after that, so one fix would be an option to limit the search of the post body to the_content() … in addition to the title, tags, author, post meta, etc.
Looks like YARPP uses
the_contentfilter to add the related posts, and that’s why Relevanssi is picking them up. The fix would be to disable the YARPP filter hook before Relevanssi indexes the posts.
Next version of Relevanssi is going to include a filter you can use to easily remove the YARPP content, but that’s not a big help right now… Well, one thing you can do is to disable YARPP, reindex the database and then activate YARPP again; that’ll get rid of the related posts in current posts.
Thanks for the suggestion, Mikko. And I look forward to the next version of Relevanssi!
- The topic ‘Exclude related posts DIV?’ is closed to new replies.