How to Beat the WordPress HTML Police

WordPress always used to frustrate the life out of me when I tried to use the HTML view to write posts.

I like writing in HTML. It’s a precise language and you’re able to control exactly how you want your page to look, especially when you combine it with CSS.

But WordPress has always had these filters in that reckon they know better than all of us.

But no more.

I was never that fussed about WordPress’ HTML police because I mostly wrote straightforward articles with a couple of images in and the Visual editor is perfect for that.

But I recently started with Jing – the free screen capture video app that lets you record up to 5 minutes of video.

And it’s so easy to use that I thought I’d put a couple of videos up as posts – which I did for my last two articles.

But that entailed moving over the the HTML view and pasting in the YouTube code. And as soon as I started messing around in the HTML view the WordPress HTML police moved in.

Because I enjoyed doing those video articles I decided that I’m going to do them more often in the future. But to do so, I somehow needed to neutralise the HTML police.

I had read somewhere that there was a plugin that removed the filters, allowing you to do everything in conventional HTML. So I went searching.

And what I found has worked brilliantly.

It’s called Raw-HTML and it allows you to do entire posts in HTML or just pick out sections of posts where, for whatever reason, you want to insert some specific code.

It only works with HTML, CSS and JavaScript – but that’s all you need for styling and laying out your articles.

After installing the plugin you can simply wrap the section you want to hand code in these tags:

<!--start_raw--> Your code snippet here <!--end_raw-->

And you can do everything between those tags in proper, conventional HTML. The WordPress HTML police are completely neutralised.

If this would solve a couple of your problems you can download it here.


Martin Malden.

What do you think?

Comments on this entry are closed.

  • tracelemental Jun 26, 2009 @ 8:33

    Nice insight – I’ve spent so much time focussing on finding a wp theme that worked for me. Now I’ve got that sorted, I’ll be more focused on the look of my articles. I like this alot.

    So does this mean it overrides the css completely?

    I’ve had some frustrations with “spacing” in articles and because you cant use the traditional html code I found there was a spacer code that I needed to use.

    • WealthyDragon Jun 26, 2009 @ 10:29

      Hi Tracy,

      It doesn’t over-ride the CSS – that sits in your theme files. It disables the HTML filters that WordPress uses.

      If you want total control of the layout of your articles you can write them in the HTML view. In this case open the article with the opening raw-html tag and close it with the close tag.

      This will give you control over spacing and positioning of objects (centre align, left align, etc) and also enable you to insert some inline CSS (which will over ride the theme stylesheets).

      I’m not sure what spacer code you’re referring to, but this plugin should enable you to get the spacing you want without the need for any special spacing codes.

      Hope that helps,



  • Ralph Jun 30, 2009 @ 9:56

    Once again, you solved a problem I didn’t know I had. I mean I had a problem but I didn’t know what was behind it – or something like that.
    .-= Ralph´s last blog post: Diggin’ Persistence =-.

    • WealthyDragon Jun 30, 2009 @ 13:25

      Ralph, hi,

      Well – at least it’s solved! 🙂

      Glad it was helpful,