Remove automatic <BR> & <P> tags in WordPress

In general rules in HTML, ‘Return/Enter’ won’t line break your paragraph as you expected like in Microsoft Words. To get the line break, you have to put the code <BR>. But, default setting in WordPress does the line break for you by hitting ‘Return/Enter’ button on the keyboard without the <BR> code. It’s annoying sometimes because we are not used to it.

It’s really easy to turn automated <BR> & <P> off on your WordPress. Go to Admin -> Appearance -> Editor -> function.php and copy & paste the following code below at very end.

Remove the Automatic <BR> & <P> Tags

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

Leave a Reply

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