How to Prevent wordpress from automatically inserting
tags everywhere

Mar 29th, 2011 | By | Category: Internet

One of the more annoying features of wordpress is it’s need to auto-format all of your html to high hell, especially when you are importing posts in html format.  Everytime you have a line break WP will put a <br \> in there, screwing everything up.

There are a few plugins around to turn this off however the ones I tried didn’t do jack so I had to go into the wp-includes/formatting.php file and specify that I like my html the way it is thank you very much.

It’s easy enough, in your formatting.php file change the following line:

function wpautop($pee, $br = 1) {
function wpautop($pee, $br = 0) {

done.. Now WP will still insert <p> tags throughout but not as many fo them.. I haven’t gotten around to solving that problem but I imagine it’ll be just as simple.  Remember that when you upgrade to a newer version of WP you might have to go in and make this adjustment again

Tags: , , , ,

Leave a Comment