Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Can I disable wpautop() only for Buddypress? Unwanted paragraph tags everywhere.

@riddler84

Participant

Have found the solution by myself. If anyone interested, here’s the code i have added to my bp-custom.php. i think it works as well in the themes functions.php.

function remove_wpautop_from_buddypress() {
	if( bp_current_component() ) {
		remove_filter( 'the_content', 'wpautop', 99 );
	}
}
add_action('bp_init', 'remove_wpautop_from_buddypress');

bp_current_component() is true, if you be on a buddypress page, so wpautop is only disabled there.
But i still wonder, why it’s necessary to do something like that. 😉

Skip to toolbar