Wordpress Stripping out your line break?
- 23
- Add a Comment
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
emily
April 19th, 2009
at 12:42pm
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.
Adam
May 3rd, 2009
at 12:46am
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!
Pau
May 5th, 2009
at 3:50pm
THANK YOU VERY MUCH!!!
I have my blog full of lonely “.” trying to emulate a line break.
Samson
May 14th, 2009
at 7:05pm
Thanks, Andrew! I was getting frustrated…
Louise
June 2nd, 2009
at 7:48pm
Thanks, but it is so ridiculous we even need to do this. I’m considering moving my blog elsewhere.
Mandy
July 10th, 2009
at 11:27am
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!
Koen
October 13th, 2009
at 8:16am
Brilliant! Thanks a lot for the work and the solution.
Derek Barney
October 15th, 2009
at 1:43pm
WOW! simple as not aligning the image left. Who would have thought of that…Thanks for the tip.
Aldo
December 21st, 2009
at 3:49pm
Actually works too, and it is easier to type.
Aldo
December 21st, 2009
at 3:50pm
Actually [code][/code] works too and it is easier to type.
Aldo
December 21st, 2009
at 3:51pm
Bah, it won’t let me enter it.
Ralph Berglund
December 22nd, 2009
at 3:08pm
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????????????
Ralph Berglund
December 22nd, 2009
at 3:09pm
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.
will
December 22nd, 2009
at 6:45pm
i want you to have my babies now!!!
Lars Tong Strömberg
January 16th, 2010
at 3:34pm
Works well! Thx!
K Thor
January 22nd, 2010
at 4:23pm
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!
g
February 24th, 2010
at 9:31am
Is there a way to actually REMOVE a line break? Wordpress seems to add a line break between my images automatically.
andrewsauter
February 24th, 2010
at 11:59am
@G
What is your blog? Can you show me an example?
Susan
April 4th, 2010
at 3:25am
And another big thank you, Andrew!
John
April 18th, 2010
at 1:23pm
You are my saviour
ionYz
April 24th, 2010
at 6:53pm
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.
Matthias
August 2nd, 2010
at 11:33pm
Thank God.
If only Wordpress would actually fix the problem. Seems like a really stupid bug to leave in the code forever.
Yemi Ogunbase
August 12th, 2010
at 4:47am
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!