Stop WordPress from adding unwanted break codes

I was recently adding some html code from a source into WordPress.  The problem, WordPress kept adding break codes <br /> and messing up the styling on the page.

I struggled with this, modified the CSS as a work around and gave up.  Today, I took another look at this issue and found this little plugin called:

wpautop-control

It works like a charm.

Once you install it, you need to go to settings and select the WordPress Default option.

Next you go to the post you want to stop WP from adding unwanted formatting and add a custom field.

Field Name: wpautop
Value: false

Update the post.  No more unwanted <br /> Codes.

If you find unwanted break codes showing up in your pages/post after you publish them, try this plugin to get things back to the way you want them and send those unwanted break codes packing.

Comments

  1. That’s an interesting solution. You know, the TinyMCE Advanced WordPress plugin will do the same thing. One potential problem is that it can mess up your tables if you aren’t careful.

  2. Mike,

    TinyMCE Advanced will remove them, but you can’t control it, it is either ON or OFF. This plugin allows you to only add it to the posts/pages you need it to be activated. This would solve your issue with tables.

    Dave