WordPress Messes Up HTML Code

WordpressI’ve recently set up a website for someone, and I decided to use WordPress as a content management system (CMS).

One thing that has always annoyed me with the TinyMCE WordPress editor is that you can’t easily add raw code you your posts and pages – because the editor tries to make sense of them as plain text and strips out all the HTML or CSS tags. So although your initial page might look fine, if you go back to edit it the editor strips all the code out when it loads it up and your design is completely mangled.

I did a lot of scouting and found that the problem is widespread. I found lots of posts on “the solution” – but not a single one with an actual method showing how to implement this apparent solution. If nothing else, you’d think the author(s) of TinyMCE would have fixed the problem by now – all it needs is a setting where nothing gets stripped out of posts.

To make matters worse – and I mean, to make me even more angry over the lack of a clear solution or even a usable workaround – many of the posts and articles are referring to files and code snippets that simply aren’t on your server after installing WordPress and TinyMCE.

Anyway, I found an ideal solution (for me, anyway). The FCKEditor doesn’t mangle your code.

I’m still testing it, but so far so good.

Update 20/5/2011: I should have done this while back, but I’m not using FCKEditor anymore. Although it doesn’t screw up HTML code, I found that it was unsuitable for me in other ways – most notably, it wasn’t WYSIWYG. So it wasn’t as ideal as I suggested above (though it might be exactly what others are looking for).

I am now using Foliopress WYSIWYG, and this one really does work the way I want it to. It is true WYSIWYG in edit mode, plus it doesn’t mangle code. Look:

<meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ />

(Visited 4 times, 1 visits today)