Go Back

Best snippet ever.

So, recently I’ve encountered the same nagging error all over the place. WordPress, likes to add <br> tags all over the place and wherever it wants to.

I’ve found the holy grail of code-snippets so it stops doing so!

function better_wpautop($pee){
return wpautop($pee,false);
}

remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'better_wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 );