Disable WordPress Spacing in Posts or Pages

Disable WordPress Spacing in Posts or Pages

WordPress automatically adds extra spacing after you press enter. If creating the HTML for blog posts.  That did, require turning off autop — the filter that normally formats post content.  To turn off the autop filter, simply add this PHP snippet to your theme’s functions.php in your active theme:

remove_filter('the_content', 'wpautop');

This tiny snippet of code remove_filter call could save you a hurs of trouble with formatting that seems out of your hands.

If your WordPress blog uses multiple themes and you’d prefer to add this functionality as a plugin, you can place the following within a PHP file to be placed in the /wp-content/plugins directory: