Blog

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.


View 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.

62 thoughts on “WordPress strips / removes blank lines while I add empty lines”

  1. 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. 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.

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

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

  5. 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)

  6. 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?

    1. 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.

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

  8. 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.

  9. 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

  10. 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

  11. 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.

  12. 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?

  13. 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?

  14. 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!

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

  16. 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.

  17. 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.

  18. 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. 🙂

  19. 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?

  20. 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.

  21. 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:

  22. 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.

  23. 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.

  24. 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

  25. 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

  26. 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?

  27. 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”.

  28. 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”.

Comments are closed.