WordPress and Adding Line Breaks – a Hack

January 22, 2012: It’s been four years since I made this original post and this solution appears to still be simplest one out there. I did a little looking around on the Internets and have seen all sorts of different attempts; plug-ins, rewriting style sheets, and long complicated lines of code. I’m a bit surprised that this is still such an ongoing issue and that so many other folks are still having to spend hours searching for a way to add line breaks. I’m glad that I have been able to help out.

I came across the issue of adding a line break on one of my pages. This page contains an iframe, which may or may not be the root of the problem. My goal was to have a couple of lines of text, space, camera image, space, and a couple more lines of text. I finally got there, but it took a little Googling. I tried using the regular tags; <br> and <br />, but they didn’t work. The original code for the iframe had the image being aligned to the left. By deleting the align code I was able to get the second line of text to move to the bottom of the frame. I still wanted an extra space under the camera image. After Googling for line breaks I stumbled on A Truth Seeker’s blog and copied this little snippet of code:
<br clear="none" />

That did the trick. I’m calling this a hack since I didn’t really bother with too much research. I just tried stuff until I got my line break. I’m also a lazy html’er. I only learn code when I want to do something. Please feel free to add your comment, especially if you know what the correct solution should be.

(Edit 1/14/2009: Deleted the link to the Harley Cam. Sadly, that page no longer exists.)
(Edit 7/9/2010: Deleted the link to the Truth Seeker’s blog. It apparently no longer exists.)

  30 comments for “WordPress and Adding Line Breaks – a Hack

  1. foobar
    December 9, 2008 at 12:51 am

    It may be a hack but it flippin works. πŸ™‚

  2. Chris
    February 14, 2009 at 12:36 pm

    Sorry, doesn’t work, just the same as a normal br tag and gets stripped out.

  3. SeVeN
    February 14, 2009 at 3:15 pm

    Well, Chris, I just tested it out and it works just fine.

  4. Andre Bluehs
    March 1, 2009 at 10:36 pm

    Looks like the reason this works is because however they are detecting the tag and stripping it for a tag, they miss it if it has ANYTHING inside it. This also works for me: . i assume if you just put something inside the tag, it ignores it.

  5. March 7, 2009 at 8:38 pm

    I was also having a lot of problem with line breaks in wordpress. I found a small plugin that solves the problem.

    This might help your readers:
    http://rubayathasan.com/wordpress/plugin/enabling-line-break-in-wordpress/

  6. March 8, 2009 at 10:19 pm

    I kind of accidentally stumbled across this. If you add the code

    <strong></strong>
    in where you want the line break it seems to work. Not a great solution, but the quickest i can think of

  7. April 8, 2009 at 1:14 pm

    Unfortunately it doesn’t work for me either. WordPress just strips the code out. That’s what seems to be the problem, wordpress stripping any sort of line break code out.

  8. April 8, 2009 at 1:21 pm

    Actually I just found that this works:

  9. April 8, 2009 at 1:23 pm

    Whoops, try this maybe (node sure if “code” tags work in the comment field)?

    <br class="blank" />

  10. SeVeN
    April 17, 2009 at 4:20 pm

    Just an FYI to anyone wanting to post a comment; the “code” tags do work in the comment box. Thanks for everyone who has been contributing.

  11. June 5, 2009 at 6:37 am

    Thank you so much for this little tip. It made my day alot easier.

  12. Nina
    June 16, 2009 at 8:56 am

    Thank you for posting this code. I worked perfect for me!

  13. Okoth
    August 9, 2009 at 9:44 pm


    is easier to remember though

  14. Okoth
    August 9, 2009 at 9:46 pm

    [code]
    [/code]

  15. Okoth
    August 9, 2009 at 9:47 pm

    can’t show the code…

    Good luck to you all!

  16. lockpro
    October 4, 2009 at 5:28 pm

    Use this, minus the spaces.

  17. lockpro
    October 4, 2009 at 5:32 pm

    sorry, this blog stripped out my code. Trying again.
    it is a p tag, a code tag, a br/ tag, a close code tag, and a p tag.
    Without the “<" it is;
    p code br/ /code p

    "

  18. October 6, 2009 at 4:46 pm

    There is obviously a lot to know about this. There are some good points here. πŸ™‚

  19. October 24, 2009 at 10:57 am

    THANK YOU FOR POSTING THIS!!! I’ve been searching for a for word press all morning! πŸ™ YOU are THE MAN πŸ™‚

  20. October 24, 2009 at 10:58 am

    word press … (BREAK)…

  21. Gr
    January 26, 2010 at 2:22 am

    Works for me! Thx.

  22. myk
    May 26, 2010 at 11:29 pm

    Just add this before every paragraph

    <&nbsp />

  23. July 9, 2010 at 10:51 pm

    This was super helpful. I’ve been Googling for a while looking for a simple fix. This rocks! Thank you.

  24. October 29, 2010 at 12:31 am

    Thank you so much for this! I had spent days looking for a fix to my line-break issue and was really relieved to discover that this trick works.

    I am very grateful!

  25. January 18, 2012 at 2:42 pm

    I use this all the time, it works awesome. Much better than all the other hacks using Div’s and other things that often result in various other issues or problems.

  26. Dave
    March 15, 2012 at 4:58 pm

    worked a treat and so simple… many thanks πŸ™‚

  27. December 4, 2013 at 5:49 pm

    only seems to work IFF there are no blank lines before or after the br tag, NOT any div elements before or after it (maybe other combos). ie. just text – otherwise it gets stripped out still, regardless of whether tag attributes are set. not so useful.

  28. Lukas
    May 2, 2014 at 7:59 am

    Simple and it works! Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *