
The wpautop()
function adds <p>
and <br>
tags to your content in order to preserve line breaks.
If you want to Disable double line breaks with paragraph elements then just add below code to your theme’s functions.php file.
1 2 3 4 5 6 7 8 9 |
remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); function aiooc_crunchify_wpautop_nobr( $content ) { return wpautop( $content, false ); } add_filter( 'the_content', 'aiooc_crunchify_wpautop_nobr' ); add_filter( 'the_excerpt', 'aiooc_crunchify_wpautop_nobr' ); |
Is there any other way to disable wpautop in WordPress using Plugin?
Yes.
- Just download plugin All-in-One Optimizer and Customizer.
- Go to
AIO Optimizer
->WP-Admin Tweaks
page. - Enable toggle: Disable double line breaks with paragraph elements.

That’s it and you are all set.

Get All-in-One Optimizer & Customizer
Simplest, most powerful, super light weight All-in-One WordPress plugin for all! 50+ Optimization, Customization & Webmaster Options in one single plugin. 🥳