WordPress strips / removes blank lines while I add empty lines


Line spacing in paragraphs plays in important usability role. Just like with happy couples, closeness shows that content is related. When paragraphs and headings are equidistant it is harder for the reader to know what is related to what.


The WordPress editor will strip out br and p tags that it decides are redundant.

WordPress will strip out multiple returns (enter).
WordPress will strip out br tags
WordPress will strip out p tags

Removing paragraph tags and break tags is not what most bloggers expect to happen. In fact, the removal of paragraph and break tags is a common source of frustration for WordPress bloggers. We want the paragraph formatting to be right. Hitting enter and enter and enter has no effect.


WordPress offers equal spacing between paragraphs

paragraph
paragraph
empty blank line / space
heading
empty blank line / space
paragraph
paragraph


To improve usability give readers spaces

paragraph
paragraph
empty blank line / space
empty blank line / space
heading
empty blank line / space
paragraph
paragraph


Here is how to add empty blank lines or spaces between paragraphs

    Select HTML mode

    Type in < p >< code >< br/ >< /code >< /p > without the spaces

    Copy and paste on each line that you want to add a blank empty line or blank space between paragraphs or headings or ordered lists or whatever.


Veiw the source code below to see an example

paragraph
paragraph
space
heading



paragraph
paragraph

I hope that if you find this helpful or you have another suggestion that you will leave a comment below.

email

55 Responses to “WordPress strips / removes blank lines while I add empty lines”

  1. Mark Says:

    Thanks. Found your website after googling “wordpress blank space”.

    My solution to this initially was to have a line with a white coloured “.” character, so that it wasn’t visible (not so easy on your site).

    Your solution is of course much more elegant.

    It seems bizarre to me that WordPress would seem so keen that you author and publish content through their admin interface, and yet make it difficult for you to format it as you wish.

    Still it’s a cracking (and free) package so i’ll forgive them :)

  2. Jim Spencer Says:

    It is a crackin’ good platform and like all of us has it’s flaws. Thanks for dropping by and leaving a comment.

  3. vinay Says:

    Hello.

    Where exactly do I have to paste the code?

    And what is the code itself? Is it ?

    I am sorry that I am ignorant about codes and this is really spoiling my WordPress experience.

  4. Caryn Says:

    Thanks so much for this. Losing blank lines between paragraphs has been driving me crazy. Looking forward to trying out this solution.

  5. Mac Says:

    Thank you. After pulling my hair out of my head trying to figure this out I came across YOUR solution. Thank again. It worked!!!

  6. Danielle Says:

    It doesn’t work!!!
    I followed exactly what you have written but still no spacing in between the paragraph.
    check out my site
    http://www.kinderlandmsia.com.my/kinderland-centres/

  7. robin Says:

    THANK YOU! I’ve been dinking around w/this forever. I do what I think should work based on html code, but no! Thanks for cracking my little personal davinci code. :o)

  8. Jim Spencer Says:

    Danielle, Are you working in the Visual or HTML editor tab? Try using the HTML tab, if you are not already.

  9. JJ Sereday Says:

    Oh man I have been messing with this for over an hour and getting soooo frustrated. Thanks for the intelligent work around.

  10. Jim Spencer Says:

    JJ, thanks for stopping by and leaving some kind words. Glad that we could ease the tension in your day. ;-)

  11. Steve Pessah Says:

    why does the code get messed up once you change things that are in the html tab? the blank lines are fine, then if i want to do something else in the html tab the spacing gets all messed up again.

    any idea how to fix?

  12. Jim Spencer Says:

    The WordPress editor has a code cleanup capability that loves to remove blank lines.

  13. Steve Pessah Says:

    so you’re saying there’s no way to fix that? just gotta keep going back and editing?

  14. Jim Spencer Says:

    The best way to approach this is through setting up your CSS so that the desired spacing is in place before and after headings, sub-headings, blockquotes and so on. You can also turn off the WYSIWYG editor.

  15. mike Says:

    And you can also enter for a little less space.

    Thanks!

  16. mike Says:

    is the code for a little less space. Sorry – did not put in enough blank spaces!

  17. mike Says:

    Whoops again! Just leave out the “br” tag in the middle!

  18. Vishal Kambli Says:

    OK. heres another solution to add blank lines, but this is not a clean method:
    add a – or . and change its color equal to the background color.

  19. Mufi Says:

    Works on my blog,. Anyhow, how to set only half space of line? thanks for sharing

  20. Kym Browning Says:

    Thanks, this is an issue that just developed on several of our blogs
    I have tried various things and this is the first useful article that doesn’t involve a lot of changes to the base site or professional html knowledge to use it.
    thanks again

  21. Jim Spencer Says:

    Mike – thanks for your comments

    Vishal – that certainly works if you change the font color to match the background color, but not ideal.

    Mufi – you can set half a line in your CSS

    Kym – if you turn off the wysiwyg editor completely you can avoid this as well, I believe.

  22. Kym Browning Says:

    I don’t use the editor at all, my partner, who does most of the posts does.
    I am planning in installing the FCKeditor in all future wordpress blogs from now on, if I put them in now it will remove all the formatting on all the pages.
    If i turn off the wysiwyg editor will it remove the formatting already on pages throughout the site?

  23. Sandra Hendricks Says:

    This is helpful. I have been using   but it only allows one space. Can you tall me how to add extra space between my reader comments? When a comment is short it shoves the next gravatar over – see here: http://gg.thisshouldhelp.net/?p=1580

  24. 0bject Says:

    This was very helpful to me, thx.

    I’ve also ha luck with this simpler version. Maybe it will help others:

    (space)

    Not sure if this will display right, here:

    Simply insert code tag in angles, then a blank space, then a /closing code tag.

    Good luck & thx again!

  25. Oti Says:

    I too was plagued by this problem, and was pulling out my hair until I stumbled on your soution. Thanks a million…

  26. Tanush Says:

    Thanks a lot. Proved of great help.

  27. photoshop stuff Says:

    Wow thanks a lot. I’ve been having issues with WordPress removing extra lines (enter) as well, you’d think they would make it an option to not do that haha. Anyways, thanks for the tip, works great.

  28. Paul Says:

    Try this plu in for the WP wysiwyg editor:

    TinyMCE Advanced

    http://www.laptoptips.ca/projects/tinymce-advanced/

    once installed and activated – in the settings under advanced it has a box that you can tick to stop removing the and tags when saving. Perfect.

    Also adds some great functions to the wysiwyg like font size and style etc.

  29. Tech Advises Says:

    Thanks for this. WordPress is really a cool platform and i don’t know why it strips out all tags. It’s pretty annoying and it looks like they will not fix this.

  30. Travelogue Says:

    Thank you!! WordPress is so frustrating, I’m glad you found a way to make it work!

  31. elvin Says:

    you just saved my life :)

  32. Kevin Kane Says:

    The WordPress editor is supposed to be WYSIWYG (What you see is what you get), but it’s not WYSIWYG for line-spacing.

    This code is helpful:

    I used it here to add an extra line before my headings: http://www.kevinkane.com/2010/12/get-a-second-monitor-to-increase-your-productivity-and-save-time/

  33. Andrew James Says:

    It worked great but now I have HUGE spaces in between my posts?
    Please have a look and tell me what I did wrong?
    Thanks :)

  34. Andrew James Says:

    Its ok. I don’t know why it did it but I just deleted the static page and then re-published it and its ok now :)

  35. Blue Goo Games Says:

    Hehe, that was pretty stupid. Thanks for the solution, although I find it easier to add a period and making it white, and I don’t have to type/paste any kind of HTML-code. :)

  36. Jim Spencer Says:

    Help me out here, what was the stupid part?

  37. Tanya Says:

    Thank you!!! Finally it worked!

  38. rygestop Says:

    Thanks had been looking for a soultion for 2 hours, and now it works

  39. adding blank lines in a wordpress page « CE Web Team Documentation Says:

    [...] from:¬†http://www.jbspartners.com/blog/usability/wordpress-strips-removes-blank-lines-while-i-add-empty-lin… [...]

  40. Another Post ABout WordPress Functions « joycechng Says:

    [...] this time’s search for a solution was a pretty easy one. This website that popped up gave a simple, and most important, working [...]

  41. Ken Says:

    I have been seeking a resolution to this problem of WP striping the blank lines and came across your elequant solution. It works fine when dealing with paragraphs and I will use it often. However, it doesn’t work so well within a list. want to place an empty line between paragraphs of an ordered list and when this solution is used WP places the solution code between paragraph tags. While the resulting page formats correctly, it will not pass validation testing. Do you have a way to insert blank lines within an ordered list that will pass validation testing?

  42. ZiggyD Says:

    Thanks for this, I have my own wordpress install so i simply use a plugin to prevent spaces from being removed. My GF, however, does not have that luxury on wordpress.com so this was a great help to her.

  43. steven Says:

    Try pasting this code in at the end of each paragraph. Make sure you are in HTML mode:

    You may only need one code instead of two:

  44. Parag Says:

    Please help me !! The actual site on which I am working – http://www.rexnordindia.in is under construction, so I m providing you the link of my another site – http://latestpricelistindia.in/wp-content/uploads/2011/11/Sample.jpg I want the content alignment as shown in the link. I have tried P-tag but no avail. Help me !!!!

  45. Sean Says:

    awesome – thank you sooo much – really appreciate this,

  46. Jason Says:

    I have the exact opposite problem. WordPress inserts line spacing on its own, forcing me to delete them quite often. It inserts this code Which really screws up my businesses website because it causes misalignment with photo spacing, making us look very unprofessional. Any suggestions?

    Thank you.

  47. Jim Spencer Says:

    The answer likely lies in your CSS.

  48. wing Says:

    the code automatically become on my side. but at least it works for me. thanks you so much!

  49. Mike Says:

    Thank you thank you thank you … this has been driving me slowly insane! Great solution, Mike

  50. paul Says:

    thank you so much!! :)

  51. Flo Says:

    I’ve tried for at last a dozen years to figure this out. Thank you, thank you, thank you!!!

  52. Ginny Brant Says:

    After I put to put lines back in my document and had it all about ready, they were all gone.

    How do I prevent from this happening to begin with. And how do I turn off the clean up editor

  53. Judith Says:

    Jim, I’m working in what’s called “text” (rather than “visual”) and it’s definitely an html editor. I copied and pasted the suggested code and once I viewed the site the code was visible! Can you offer any help, please?

  54. Insiston Says:

    span paragraph paragraph-close span-close

    last attempt to tell you

  55. Linda Willis Says:

    Thanks for this great tip! Like many of the other posters, this had been driving me mad! WP left just in the HTML and omitted the tags. Regardless, it put in a space after Heading 3, which I really wanted!

    Appreciate your time in sharing this with us. Found you Googling “add space after headings in WordPress”.

Leave a Reply

Home | Resources | About JBS Partners | Contact us
Replica Watches Buy In China Cheap Replica Watches Rolex President Fake Rolex Watches For Sale In South Africa Best Breitling Replica Watches Best Buying Replica Watches Online Replica Rolex For Sale In The Usa Swiss Replica Watches For Men Buy Cheap Replica Watches In India Replica Watches Omega Speedmaster Cheap Replica Watch Wholesale Antique Rolex Replica luxury victorinox watches for sale High Quality Swiss Movement Replica Watches Ferrari Replica Watches Uk Buy Replica Cheap Watches Online India