Loading
Loading....

Wordpress Stripping out your line break?

I had to deal with the issue several hours today of Wordpress stripping out any line break code I tried. I assume it’s some sort of bug, although it seems to be happen with all versions of wordpress. It seems to happen after you left-align a picture. Anyway, I read multiple blogs and none of them seemed to offer a solution that actually worked, usually Wordpress just immediately strips out the code when you switch to visual mode. Didn’t seem like there was anyway to force a line break or make Wordpress stop stripping it out. Anyway, after messing with it for several hours I found a simple solution, just click over to the “HTML” tab and put this code where you want your line break:

<br class="blank" />

That should do the trick. Has worked so far in every version of Wordpress I’ve tried.

23 Comments

THANK YOU.

words cannot express how much thank you i feel right now. ha. i’ve been tearing my hair out for a week about this. you’re my hero of the day. seriously.

Thank you SO much! Countless hours of sifting through plugins and CSS hacks but nothing works. Sometimes all you want is a quick line break after something and you have made that possible now!

THANK YOU VERY MUCH!!!

I have my blog full of lonely “.” trying to emulate a line break.

Thanks, Andrew! I was getting frustrated…

Thanks, but it is so ridiculous we even need to do this. I’m considering moving my blog elsewhere.

This has been bugging me for a long time. Finally today I decided to spend some time looking for a solution and found your posting. Thank you so much – this is a life saver!

Brilliant! Thanks a lot for the work and the solution.

WOW! simple as not aligning the image left. Who would have thought of that…Thanks for the tip.

Actually works too, and it is easier to type.

Actually [code][/code] works too and it is easier to type.

Bah, it won’t let me enter it.

Thanks for the Christmas present which I finally found in the Wordpress Forums after hours of frustration. Why, why, why don’t such elemental html tags as or work on the world’s most widely used scripting software????????????

Sorry, I forgot. It stripped out my cosde. I was referring, of course, to paragraph and line breaks. Geeez, they won’t even let me mention them in print.

i want you to have my babies now!!!

THANK YOU>
I have been searching for this for far too long, and stumbled on it today through the wordpress forums. THANK YOU for posting this, and posting on that forum!

Is there a way to actually REMOVE a line break? Wordpress seems to add a line break between my images automatically.

@G

What is your blog? Can you show me an example?

And another big thank you, Andrew!

You are my saviour

Thank you for this snippet of code. As someone very familiar with HTML and CSS I was considering upgrading to modify the CSS just to add heading padding but this will do for the time being.

Thank God.

If only Wordpress would actually fix the problem. Seems like a really stupid bug to leave in the code forever.

Andrew,

Thank you so much for this!

This blog post helped me tremendously, because with my anal-retentive nature (I’m a Virgo…not my fault), not being able to put in proper spacing was starting to piss me off.

Again, thank you for this!

Leave a Comment