Enabling Line Break “<br>” in Wordpress
Finally!! A permanent solution in order to prevent Wordpress from filtering line breaks "<br>" from a post.
In spite of trying various methods such as putting line breaks "<br>" inside "<code>" tag and many other such HTML tricks (many of which can be easily found at Wordpress) just to be able to put multiple intentional line breaks in a post, wordpress would eventually manage to filter those line breaks. Even if the tricks were successfully applied, when it came to re-editing a post, all efforts would go to vain when TinyMCE initiates its own filtering process.
Wordpress has a built-in powerful post/text editor commonly known as the “Visual” editor, which uses the open source project named “TinyMCE“. When switching from Visual to HTML editor in Wordpress or vice-versa TinyMCE executes a back-end filtration process which removes empty tags, and <br> tags from the post.
Needless to say, it is very irritating when a author is forced to loose his/her creative ideas by forcing these kind of annoying and unnecessary filtration. Many has expressed their annoyance regarding this issue, as evident HERE.
Most of the time I would just reverse engineer stuff that really bugs me, silently and without complaining. But this time around I have found a solution for this problem without any reverse engineering.
TinyMCE-Advanced from wordpress is a wordpress plugin, which adds the option to disable the removal of <p> and <br> tags when saving a post and in the HTML editor (autop). After installing-activating, the option to enable line breaks can be found in the Settings->TinyMCE Advanced panel.
![]()
The plugin along with adding the functionality mentioned above provides the ability to add many more very useful buttons in the Visual editor, which is a big plus.

Blogging should be a little more easier from here on with the freedom of unlimited line breaks in wordpress :)…
Please feel free to suggest other ideas below and/or let me know if this did the trick for you too.
Related posts:
- Wordpress on Windows IIS Server with SMTP - Wordpress 2.7 runs very smoothly on IIS 6 with PHP...
- Infolinks Ad Integration Wordpress Plugin - The Infolinks Plugin for WordPress 2.8++. Infolinks In-Text Advertising are...
- Elegant-Grunge-Mod, Customized Version of the Wordpress Theme - The Wordpress theme Elegant Grunge originally designed by Michael Tyson...

February 28th, 2010 at 3:58 pm
Thanks. I was getting of cursing at my screen about where the hell my went.
February 20th, 2010 at 8:20 am
Thank you very much!!
This plugin really help me.
You are a saviour!
February 16th, 2010 at 1:17 pm
[...] Credit: I also just ran into this post by Rubayat Hasan that discusses a plugin that addresses this issue, namely it upgrades Wordpress’ native WHISIWIG Editor to [...]
February 11th, 2010 at 1:04 pm
[...] Finally!! A permanent solution for Wordpress formatting issues Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.Powered by WP Greet Box WordPress PluginThe exerpt below was taken from this original webpage: rubayathasan.com [...]
February 11th, 2010 at 10:34 am
Very helpful. It makes WP a whole lot better. Thanks a lot!
February 10th, 2010 at 2:29 pm
Love it, Thanks.
February 7th, 2010 at 3:03 pm
Excellent. I use TinyMCE Advanced and I didn’t even notice that option!
February 2nd, 2010 at 2:17 pm
Thank you for posting this, works like a charm.
January 30th, 2010 at 5:22 pm
works like a charm! thanks!
January 10th, 2010 at 4:03 pm
thanks for this tip. but why wordpress remove br tag automatically?
January 8th, 2010 at 12:33 pm
Thank you, this worked wonders!
December 17th, 2009 at 12:05 pm
Thanks for this post. It has somewhat fixed the problem but not 100%. I don’t understand why the hell Wordpress decides to strip out BR tags.
When enabling the option you mentioned, all it does is create a new CSS class called br_fixer and whenver I type out a proper BR tag, it gets replaced with a P tag using the br_fixer class so instead of getting a clean line break, I get two line breaks.
All I want to do is use a simple BR tag
December 18th, 2009 at 1:10 am
yeah I know its annoying as hell!! but it at least provides “an” easy solution for the time being :)
December 15th, 2009 at 8:24 pm
THANK YOU for mentioning the plug-in! It worked perfectly! I’m laughing at Jo Anne’s comment above. LOL. I totally feel sympathize. It was driving me utterly bonkers! LOL. Thanks again! :D
November 18th, 2009 at 9:31 pm
Thanks very much, it worked wonderfully!
October 28th, 2009 at 6:04 am
Hm br is changed into p and /p afterwards (with the before and after it)
Either way it works so.. Im happy. :P
October 7th, 2009 at 3:00 pm
[...] expliqué ici, il vous suffit de cocher la case [...]
September 28th, 2009 at 4:24 am
Thanks for the tip. I fixed the issue before, but couldn’t remember how. Thanks!
September 23rd, 2009 at 7:24 am
Finally a nice solution :), the boss was constantly complaining that the breaks weren’t saved. Thanks Rubayat, you saved me a lot of walks to the bosses office.
September 16th, 2009 at 9:03 am
AHHHHHHHHH!
thankyou for this post.. best solution so far!
September 4th, 2009 at 11:10 pm
Thanks, this works just fine for me!
I can’t add a in the html tab, it won’t work. But I can add line spaces in the tinyMCE editor, and it works no prob with the plugin installed.
August 11th, 2009 at 3:29 pm
Searched all over and never could figure out how to stop TinyMCE from stripping my br and paragraph tags. I installed TinyMCE Advanced, and everything is working PERFECTLY.
Thanks Rubayat!
July 31st, 2009 at 7:58 am
Thank you for this information. It seems to have gotten even more strict in WordPress 2.8 Used to be able to include arbitrary space here and there, but now it’s all gone.
July 24th, 2009 at 7:39 am
thanks !!
June 13th, 2009 at 12:24 pm
woow.. really thanks for this. i am tired that my post always shrink due to the removal of “BR” tag.
hope no more.
thanks again
May 24th, 2009 at 11:20 pm
Sorry. the comment before removed some html tag. I rewrite the comment.
I am using wordpress 2.7.1 and TinyMCE Advanced 3.2. I also enabled the option “stop removing br and p”
It allows me to add break line in the Visual View. However, it also add an extra break line at the beginning and the end of the content whenever I save or update the content from visual view. Is there anyway to fix it?
May 23rd, 2009 at 12:45 am
You rock. World needs more souls like you.
May 6th, 2009 at 12:10 am
Gracias! Lo unico que funciona… y de maravilla!
April 30th, 2009 at 2:40 am
It exactly what I needed. now I use this plugin especifically for BreakLine et Blocquote button ! Thanx a lot.
March 31st, 2009 at 2:55 pm
For some reason, this partially fixed my issue, but the editor is still taking out half of the tags and replacing them with . Does anyone know the underlying PHP file that controls the WP logic on this? I want to strip out the find/replace PHP function since nothing else seems to work. I found several other suggestions… one said to use but when I do that, WP then adds an extra … it’s totally crazy. Thanks for the above suggestion, I never noticed that checkbox in TinyMCE.
March 31st, 2009 at 2:58 pm
… my html code was stripped out of the above post …
the code was ( … but that doubles up my line breaks
March 31st, 2009 at 10:54 pm
your code didn’t come… but what tags are exactly getting replaced though?
you can try modifying:
/path/to/wordpress/wp-content/plugins/code-markup.php
and look for something like,
add_filter(‘the_content’, ‘…’, ‘…’);
I am not sure, if this will fix it but let me know if it does.
June 5th, 2009 at 3:28 pm
yeah parker I’m still having the problem too. Rubayat I am sure that you do indeed rock, but apparently I need more rocking to rock my problem away. It’s still stripping out my br tag on one of the “pages” (this one: http://syzygysailing.com/crew) For the life of me I can’t get the text to always start below the image
March 21st, 2009 at 5:39 am
You rawk man. A LIST FULL OF COMMENTS at another blog post about how to break lines came up useless.
Yours linked here… PROBLEM SOLVED.
Thanks!
March 20th, 2009 at 10:58 am
You are a saviour! Thankyou!
March 20th, 2009 at 2:22 am
Thank you for pointing me to Tiny MCE. I am really glad to know about it; maybe my hair that I pulled out will grow back!
March 21st, 2009 at 4:01 am
:) I am glad Jo Anne that it was helpful. Thank you for your comment.