Been swearing at WordPress this afternoon…
I’ve been trying to transfer an html form, which I had working perfectly on a static html page, onto a WordPress page. WordPress insisted on adding multiple <br/> tags where I didn’t want them. Mutter.
Eventually, after much searching, I identified a parameter within wp-includes/formatting.php, which allows you to disable this irritating feature. If you open formatting.php and find the function wpautop you’ll see this:
function wpautop($pee, $br = 1)
Change this to:
function wpautop($pee, $br = 0)
Save the file and publish it back to your server and that’s it. Works fine in WP2.8.
Note: WP 2.8.3 overwrites formatting.php so this change needs redoing.
Update 24 October 2010
Fed up with repeatedly doing this I’ve developed a WordPress plugin to address the issue. Give it a try and let me know if it works for you.
cheers, mate!
Great solution! It works perfectly! Thanks for sharing!
I can now stop headbutting the desk – until the next update.
Awesome. I too was doing some headbutting. $#%!!!
Thanks a lot for posting this solution!
Thank you so much!
Awesome – this helped me out heaps. Thank you.
You are a life-saver! I am forever indebted to you!
Great post – thanks so much.
What an annoying little feature that is – auto adding line breaks behind your back!
Thanks!!! I was stumped with this one when creating some shortcodes.
Thanks a million, I was pulling my hair out!
Thanks! This was driving me crazy!!! And this fixed it
tx!It can solve the problem
You total and utter legend – its been driving me nuts
Definitely NOT the proper way to do this guys. If you ever update WordPress, you’ll need to edit this each time. Best option is to wrap the fix in a custom function.
…which is what I’ve said, and why I wrote the plugin…
THANKS!!!!