WordPress.org

Ready to get started?Download WordPress

Forums

Raw HTML in Write Post (4 posts)

  1. bringageek
    Member
    Posted 7 years ago #

    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.

    Cheers,

    Phil

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  3. a1exus
    Member
    Posted 7 years ago #

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

  4. infopede
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic