WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Preventing WP from rewriting HTML in post (11 posts)

  1. lunarboy
    Member
    Posted 7 years ago #

    How do I prevent WP from rewriting my HTML when I use the HTML source editor in a post?

    I've run into 2 instances this weekend when I've tried to format a post or embed a QuickTime movie into a post only to find that WP is deleting tags or adding tags.

    I've even tried turning off the visual editor, but WP still does the rewriting.

    Thanks.

  2. Samuel B
    moderator
    Posted 7 years ago #

    There are several plugins to stop this from happening.
    http://www.thunderguy.com/semicolon/wordpress/code-markup-wordpress-plugin/
    One example - you can search for more.
    http://codex.wordpress.org/Plugins#Plugin_Lists_and_Repositories
    or just Google for it.

  3. lunarboy
    Member
    Posted 7 years ago #

    Hi Samboll:

    Thanks for your suggestions. However, after looking at that plugin and others, it's not really stopping what I'm talking about. I don't want to display HTML markup, I want to use it within my post and not have WordPress rewrite it.

    For example, I wanted to embed a QuickTime movie into my post using HTML. But as soon as I add the traditional [object] and [embed] tags, WP adds extra [p] tags and screws it all up.

    Another instance is when I needed to put 2 paragraphs [p] within one [div]. WP stripped the first [p], closed the [div] and then started a new [p]. Clearly not what I'd intended.

    Thanks.

  4. Marcomail
    Member
    Posted 7 years ago #

    same problem

  5. yami
    Member
    Posted 7 years ago #

    Have you tried Text Control? It has a nice "no formatting" option.

    Also, make sure that under Options > Writing, the "correct invaidly nested XHTML" box is unchecked.

  6. mwillse
    Member
    Posted 7 years ago #

    WordPress is terrible with this. I've been trying to put a form on one of my pages and wordpress destroys the formatting with useless [p] tags.

    In some cases, I've avoided trouble by pasting my code without any tabs or line breaks.

    I wish there was a way to turn off html parsing for individual posts or pages. Or a command to wrap around text that you don't want wordpress to touch.

    Text Control looks all right. But this is a core issue that shouldn't be fixed with duct tape.

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

    It's not an "issue", it's a design decision. It's made for people who *don't* know HTML. If you really needed to put a form in a page, then the idea is that you'd know enough to make a new page template with the form in it and use that for your page instead.

    And if you really want to disable the automatic paragraph formatting (although I don't see the point of doing so, myself... proper semantic text would have paragraph markers in it), then here's a plugin to do that for you.

    http://ottodestruct.com/wpstuff/disableautop.zip

    You'll also probably want to turn off the "WordPress should correct invalidly nested XHTML automatically" option on the Options->Writing page.

  8. lunarboy
    Member
    Posted 7 years ago #

    Truth is my wife and I share a blog. I know enough HTML to format things myself or to add Flash or QuickTime movies. But my wife does not. So I don't want to disable the auto formatting altogether. I'd like to be able to do it on a per post basis for those ocassions where I want to embed a YouTube video for instance.

    TextControl works like a charm, thanks for the suggestion. However, you must also turn off the visual rich editor in your user profile in order for it to work.

  9. Try Viper's Video Quicktags. Makes inserting videos quite painless, and doesn't involve broken code:

    http://www.viper007bond.com/wordpress-plugins/vipers-video-quicktags/

    NOTE: Site is currently down, should be back once Viper has finished moving to a new host (or so it says).

  10. New host is having issues. WordPress (and most other scripts) just show blank pages. Still working on it. My friend will be going to the data center to reinstall Fedora on it tomorrow. Hopefully that'll fix it.

    For now, here's a temporary direct link that'll work.

  11. My site is back up. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags