Wordpress Stripping out your line break?
- 32
- 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.

32 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!
Renise
November 17th, 2010
at 11:28am
Boy this absolutely saved me. I was getting tired of fixing line breaks daily. It is very frustrating and I do not know why Wordpress developers do not address this. It makes the job of blogging so tedious.
Anyway thanks a lot!
Kim
December 2nd, 2010
at 2:44pm
THANK YOU!!!!! This was an extremely welcomed fix to the WP issue. I was fighting this for a few hours for a client and was about to give up.
Heather
December 10th, 2010
at 3:55pm
I, too, have been struggling with this disappearing line break issue. Thanks very much for the code. I hope it works. I see from my research that this problem has been a frustrating issue for several years now. I don’t understand why it’s still a problem and hasn’t been fixed in newer versions of Wordpress.
Jim
January 16th, 2011
at 2:32pm
Great post.
Another way to force a line break in a wordpress post is to use a paragraph tag with a blank space in it as explained here:
http://www.theblogaholic.com/2011/01/16/add-line-breaks-in-wordpress-posts/
Pam
March 30th, 2011
at 10:15am
PHEW! Been looking EVERYWHERE for this!
Works like a charm.
THANKS!!!
Carey
August 12th, 2011
at 5:22am
Thank you thank you thank you. This has been bugging me all morning.
veeru
September 23rd, 2011
at 12:19pm
Thank You for sharing this useful tip. Nice Blog Nice Work. Keep it up.
Louise
October 14th, 2011
at 5:54pm
ditto ditto ditto the thanks expressed! Great marketing move to do this. Shows your business in a very good light.
Torsh Johansen
December 21st, 2011
at 4:09pm
Trying to make…
a line break without those codes!