Title: Exclude related posts DIV?
Last modified: August 21, 2016

---

# Exclude related posts DIV?

 *  [peter-a](https://wordpress.org/support/users/peter-a/)
 * (@peter-a)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/)
 * 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/](http://wordpress.org/plugins/relevanssi/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287270)
 * How are those related posts added to the post? Is it a shortcode?
 *  Thread Starter [peter-a](https://wordpress.org/support/users/peter-a/)
 * (@peter-a)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287310)
 * 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.
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287393)
 * 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.
 *  Thread Starter [peter-a](https://wordpress.org/support/users/peter-a/)
 * (@peter-a)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287412)
 * Thanks for the suggestion, Mikko. And I look forward to the next version of Relevanssi!
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287443)
 * 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.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Exclude related posts DIV?’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

## Tags

 * [search results](https://wordpress.org/support/topic-tag/search-results/)
 * [YARPP](https://wordpress.org/support/topic-tag/yarpp/)

 * 5 replies
 * 2 participants
 * Last reply from: [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/exclude-related-posts-div/#post-4287443)
 * Status: not resolved