Support » Fixing WordPress » Removing extra newlines

  • Is it possible to add the checkbox “Do not insert [br] tags” when posting to WordPress? A lot of the postings on my pages are separated with [pre], so adding additional breaks increases the page and is generally undesirable.
    Is there a way to make WordPress not add the [br] tags into the post that I don’t know of?

Viewing 4 replies - 1 through 4 (of 4 total)
  • In includes/functions change $br = 1 to $br = 0 in the autop function.

    That function is now in functions-formatting.php

    This works like a charm. Hope to see it added to Options someday; it’s too important to on be able to change it by editing the code; too many users will be turned off by it.

    I guess I get to update the info for the 1.5 release, since I just had to figure it out:

    The file is wp-includes/functions-formatting.php.

    The fuction is wpautop (3rd from the top in my distro).

    The line to change starts with if ($br) $pee = ...

    The way to change it is to add a comment marker // at the beginning of the entire line.

    The effect this will have is that single newlines (returns) in your editing window such as those you use to wrap lines of text, will not be reflected in your published post, which will therefore contain automatically wrapping paragraphs. And this seemed to work for all existing posts in your database.

    At least this is how it seemed to work for me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.