Skip to content

Disappearing line breaks in WordPress – SOLVED

August 24, 2011

If you’re blogging with WordPress, you may have been annoyed by the fact that if you enter a lot of line breaks for spacing purposes, they disappear when you publish the blog entry. Regardless of whether you’re using the Visual Editor or the HTML editor, WordPress strips away any extra line breaks. It doesn’t matter you’re hitting Enter, using <br> or <p>, or anything else, it’s always the same. They vanish, and your beautifully organized entry is transformed into a jumbled mess.

Why? God only knows. But there is a solution.

I’m assuming that you’re inserting all these line breaks because you’re trying to create space around a picture. Most likely, you have a picture aligned on the right or left, and you have text going part of the way down it, like this.

But you don’t want the next paragraph to follow immediately on and continue wrapping around the picture, do you? You want the next paragraph to begin underneath the picture, like this, so that it will look elegant. So how did I just achieve that? There’s a bit of code designed to help in these situations. I got this information from this forum discussion.

First, ensure you’re using the HTML editor, not the Visual Editor (you switch between them using the buttons on the top right of the text window; see image right). If you’re not familiar with HTML, I suggest writing the entry and inserting the pictures BEFORE switching to the HTML editor.

Then, after each paragraph that has a picture aligned to it, enter <br style=”clear:both;” />

This little bit of code tells WordPress to begin the next paragraph underneath the picture, not next to it. Simple.

So, to clarify, your entry would look like this:

A paragraph of text with an aligned image.

<br style=”clear:both;” />

Next paragraph

IMPORTANT: stay on the HTML editor, do not ever return to the Visual Editor, or it will strip the code away and you’ll have to start all over again. Why? God only knows.

If any of the above is unclear, drop a comment and I’ll clarify.


From → Blogging

One Comment
  1. Thank you Sir!! you saved my life

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: