WordPress has a function called wpautop()
that very kindly “autowraps” and adds paragraph tags (<p></p>) around elements of your content. While this is extremely helpful for users, those that may be more unfamiliar with HTML and those that only want to use WordPress as a content publishing platform. Those users that desire more control over the structure of the site may want to manage what elements exist or don’t exist in the content structure. For a long time, WordPress users have had access to filtering out the wpautop()
function by adding a simple line of code to their functions.php
file of their active theme folder.
remove_filter( 'the_content', 'wpautop' );
But the above code can also leave users with an unintended issue. This code snippet will remove ALL the auto-inserted paragraph tags. To truly have control over when and where this wpautop()
function interacts with content, we need to be able to manage this on an individual post/page level. This is where WordPress’ Custom Fields
come to the rescue. If you do not see a metabox on your post/page editor screen, you may need to enable the metabox to be visible from within the Screen Options
located inside the drop-down tab in the upper right of your screen window.