skip to Main Content

How to remove <p> and <br/> tags in WordPress posts?

Whenever we posting some content in WordPress post page it is showing some paragraph tags like <p> and <br/>. Which is showing some extra space in output. So, how to remove all the tags?

This happens because of WordPress’s wpautop. Simply add below line of code in your theme’s functions.php file

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top