Remove Automatic Line Breaks
from Wordpress

This is for me to remember only. Thank God someone had the consideration to post their findings on the internet.

When I code, I like ample spacings between the codes so their are more easily read, but Wordpress reads those spaces as line breaks.

Find this line in your b2functions.php (inside your b2-include folder):
function wpautop($pee, $br=1) {

Replace it with:
function wpautop($pee, $br=0) {

And no more extra line breaks!

This person took 5 hours to find the solution I needed, 5 years ago.

Here’s a link to you!

Remove extra line breaks in WordPress

One Response to “Remove Automatic Line Breaks
from Wordpress”

  1. Sean says:

    Actually it’s a nice feature to have linebreaks inserted.
    If you want to suppress the automatic s for achieving a predefined layout, just insert a linebreak (press enter) in the HTML editor (quite counterintuitively) or do the same in the visual editor by pressing shift+enter.

Leave a Reply