Get Adobe Flash player

WordPress editor adds unwanted HTML (p br)

In an effort to better perfect the WordPress engine, the developers may have gone a step too far in the wrong direction. WordPress is a Content Management System (CMS), even if it is a blog, and yet, in an effort to protect you from yourself, WordPress modifies your content for you.

It’s annoying, especially for those who know what’s going on. For those who really know what’s going on, they have to take time to combat such behavior  by writing a plugin.

One problem?

When you add an image to your content, you would do so by adding the following line:

<img src="image.jpg" alt="" />

However, WordPress doesn’t think that’s exactly what you want to do. They feel a correction is necessary, and so they modify your code as such:

<img src="blah.jpg" alt="" /><br />


It’s ridiculous, because this alone will prevent you from placing two images horizontal to each other, due to the BR insertion. Perhaps it’s a stroke of genius and I’m not swift enough to understand it. Of course, I realize some people actually need protection from themselves. You know, they might install a malicious plugin. Yet, is modifying content code the correct solution?

W3C you say? That’s fine, but leave the content to content creators and the engine to developers.

As of today, there is no simple solution to overcome this. Instead, a new plugin has been born created to override the WordPress “bugs.”  It’s called RAW HTML and gives you an inline option to avoid the WordPress fault.

If WordPress wants to keep and master this behavior, how about giving us an option, especially if we use the HTML editor and not the Visual editor?

One Response to “WordPress editor adds unwanted HTML (p br)”

  • I couldn’t agree more. If they insist on inserting unwanted and tags, then why bother with an HTML editor option? Very, VERY frustrating! I have heard that there are filters you can use via plugins to minimize/eliminate this – perhaps this is what RAW HTML does…?

    Anyway, thanks for a starting point. Will keep researching and see what other solution(s) I find.

Leave a Reply

Maria Austin