Support » Fixing WordPress » Raw HTML in Write Post

  • I’m looking to past HTML code into a post. However, WordPress keeps reformating it to Paragraph tags or something more drastic.

    In past versions there has been an HTML button allowing me to control the HTML of the post, but now it’s gone. And furthermore, if I use the VISUAL or CODE layout it does the same thing.

    This is a bit time sensitive — I’ve got a meeting in a hour to find a solution. The people using my blog are going to be quite HTML savvy. We need to be able to insert HTML code into posts without WP mucking about with it.

    Let me know… Thanks in advance.



Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    The “Code” tab lets you post exact code to the database, without messing with it. If you switch back to the visual tab, the javascript editor may mess with it, however. You can disable the javascript editor in Users->Your Profile.

    However, WordPress itself will mess with your code when it actually displays it on the page, if it thinks that it’s invalid in some way. And it’s not perfect at it either. Search for “wpautop” on these forums and you’ll find why it’s putting paragraph tags and such in there. There are improvements being made to this functionality all the time, so your problems may be fixed in future versions.

    You can disable wpautop if you like. Edit the wp-includes/default-filters.php and comment out the add_filter('the_content','wpautop'); line. Note that doing this *will* make you put in every last little thing. You won’t get <p>’s for free anymore.

    what about ‘ single quotes? how can i disable wordpress not inserting back slash \ in front of it?

    Well????? Any answer to a1exus’ question from 11 months ago?
    This is a royal PITA and it only seems to be adding the back slash when inside a script block. Thus, it breaks the script.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Raw HTML in Write Post’ is closed to new replies.