Support » Fixing WordPress » How to disable KSES?

  • I just imported all my entries from MovableType, only to find that hundreds of entries look horrible because the HTML in them is blocked by KSES. Since I am the only user of this blog, and I do not allow commenters, I would like to simply turn off KSES entirely. I can’t seem to find any explanation of how to do that. Help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • a search of the codex would have displayed a nicely written answer…

    If you would like to override the $allowedtags variable in kses.php you may do so in your my-hacks.php file, provided you add the following code after you set up the $allowedtags array.

    define(‘CUSTOM_TAGS’, true);

    You can also just uncomment the tags you want displayed in kses.php but the above will not be overwritten upon the next upgrade.

    That’s exactly the answer I got when I searched. I’m not looking for a way to add more allowed tags. I’m looking for a way to turn off KSES entirely – that is, have it not be looking for things to allow in the first place, but instead simply get out of the way and not be disallowing anything at all.

    Moderator Matt Mullenweg



    KSES has nothing to do with the content of your entries, it only effects comments. If you still want to disable it you can remove the filters using the remove_filter function.

    Then why, when I paste, say, a Flickr badge into WordPress, does it escape all the HTML tags and add linebreak tags?

    What I would like to do is be able to paste code – for instance, a Flickr badge ( , if you have a Flickr account ) – into a post.

    Moderator James Huff


    Go to Options/Writing and deselect “WordPress should correct invalidly nested XHTML automatically”.

    That was already deselected.

    Moderator James Huff


    Well, when WordPress’ lead developer says that it isn’t KSES, you can be assured that it isn’t KSES. As for what it is? If it’s not WP’s XHTML correction, then I don’t know what it is.

    dmd’s problem stems from wpautop filtering on content. I too am in the middle of a migration from MT to WP and found this quite frustrating since the imported content looked right but the output was wrong. I found the “text-control” plugin and my life is much better, once installed choose “unformatted” for your default.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to disable KSES?’ is closed to new replies.