How To Insert Line Breaks In WordPress


I don’t know about you, but WordPress really has been getting on my nerves lately with it’s visual editor. Not sure why, but it doesn’t allow me to insert line breaks in posts no matter how many times I press enter. Why this is I am not sure but the problem has been around for some time.

After some lengthy trial and error periods, I finally have been able to add some ‘get arounds’ to my inventory. Unfortunately, I still have not worked out how to make it so that when you push enter, a line break is added. Why WordPress don’t sort this out I have no idea. If there is any code that anyone knows of to insert into one of the php files then let us know in the comments section!

How to insert line breaks in wordpress

Code Method 

Ok so the first method is to use a small bit of code in the html part of you’re editor. So what you do is click html at the top right of you’re editor. Then find the part of you’re post which you would like to add a line break after. Then on the very next line paste the following:

<br>

This will insert a line break. However here is the important part, do not go back into the visual editor as this will strip the code instantly. You need publish in html mode, then you can go back into the visual editor to do whatever you want. So go ahead and try inserting line breaks with this method. 

Plugin Method

The other way I used, and also prefer myself is replacing the default editor with a more advanced editor, so to speak. You will need to download and install this plugin. In you’re dashboard area of WordPress, hover over plugins on the left hand side and click add new. Then search for a plugin named ‘tinymce advanced’. The reason why I prefer it is that there is so much more to it than just getting around the line break problem.

This plugin gives a wealth of advancement in terms of editing unlike the default editor which is very limited. You have a huge range of useful extra buttons to add to the editor and enhance you’re post. Anyway, moving on…

So once you have installed the plugin you just need to go ahead and write up you’re post as normal. HOWEVER, what you need to do, is when you want to insert a line break, you need to press shift+enter. Yes that’s hold shift and enter. This will enter a line break. If you do not do this, it will by default insert a two line space. But oh well, you may prefer double line breaks!

One thing to take into account is that editors from plugins, they have been reported to be unpredictable and stop functioning like usual. As an example, as I am writing this post, when I was pressing enter at first, it was inserting the ‘&nbsp’ code automatically in the html editor which inserts the double line break. But when I pressed shift+enter to insert a line break, thereafter it began inserting single line breaks with me just pressing enter alone. I did say unpredictable!

So there you go, that’s how I have been entering line breaks recently into my posts. Let us know how you get on in the comments section below.

Thanks for reading, hope it helped!

Speak Your Mind

*