This was an annoying bug on one of my wordpress + buddypress for a while and the fix is amazingly simple :
Edit your wp-includes/query.php around line 2762
// Always sanitize
foreach ( $this->posts as $i => $post ) {
$this->posts[$i] = sanitize_post( $post, 'raw' );
}
and replace by :
// Always sanitize
if ( $this->post_count > 0 ) {
foreach ( $this->posts as $i => $post ) {
$this->posts[$i] = sanitize_post( $post, 'raw' );
}
}
Latest posts by Fab (see all)
- Voyage au bout de la nuit: review - 15 October 2025
- 2025 New Years Eve Party - 29 September 2025
- Think on these things: review - 2 September 2025

That was amazing thanks!