WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
Exclude related posts DIV? (6 posts)

  1. peter-a
    Member
    Posted 8 months ago #

    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: <div class="yarpp-related">

    Is there any way to do something like that?

    http://wordpress.org/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    How are those related posts added to the post? Is it a shortcode?

  3. peter-a
    Member
    Posted 8 months ago #

    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.

  4. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    Looks like YARPP uses the_content filter 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.

  5. peter-a
    Member
    Posted 8 months ago #

    Thanks for the suggestion, Mikko. And I look forward to the next version of Relevanssi!

  6. Mikko Saari
    Member
    Plugin Author

    Posted 7 months ago #

    Just a quick update: looks like disabling YARPP is not simple. Also, I'm not sure how YARPP is even being activated. It runs on the_content filter – but Relevanssi is not applying the_content filters.

Reply

You must log in to post.

About this Plugin

About this Topic