• My site has a series of static Pages, and in some of these pages the content region must contain a chunk of HTML which I’ve tried to stuff in the WYSIWYG window. Each time it’s saved, though, the editor re-writes the markup. Example, I paste in this:

    </div>
    <div id="pagepic" class="right"><img src="/images/wrapper_work.jpg" alt="work" /></div>

    and I get this:

    <p id="pagepic" class="right"><img src="/images/wrapper_work.jpg" alt="work" /></p>

    Is there a plugin which will force the WYSIWYG to interpret HTML more literally?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Darren

    (@cutout)

    WordPress is replacing my div tags with p tags, stripping break tags, and otherwise reinterpreting code in a way that is making the WYSIWYG tool a complete detriment to the software. Is no one else having this experience when creating static pages?

    I turned off the WYSIWIG editor for that reason alone. The HTML editor isn’t perfect (still won’t let you post pure HTML; try inserting a comment) but it’s a huge step forward.

    As far as I’ve been able to determine, the only way to post “pure” html tags without wp insisting it knows better is to work within the database using phpmyadmin. And that is NOT an option for the faint of heart – one misplaced semi-colon among other possible things will bork the whole shebang – and your only option at that point is to drop all the tables and import a backup dump – assuming you have one.

    So if you’re going to do this (and I admit, I do it myself on a regular – that is, daily – basis), make sure you have a dump before you start.

    You have been warned…. “DANGER Will Robinson”…..

    No thanks. I’m not afraid of phpMyAdmin; it just seems like it’s not a lot of sugar for a dime.

    *snicker* Yeah, you’re probably right. Then again, there’s anal…. and there’s ANAL….

    LOL! Good thing I wasn’t drinking any water just now.

    Um. Worse with red wine….

    Thread Starter Darren

    (@cutout)

    make sure you have a dump before you start.

    it just seems like it’s not a lot of sugar for a dime.

    there’s anal…. and there’s ANAL….

    This thread just gets dirtier and dirtier.

    For anyone interested, there’s also this suggestion which I’m about to try.


    the only way to post “pure” html tags without wp insisting it knows better is to work within the database using phpmyadmin.

    That is depressing, considering how much faith I otherwise have in WP. Why even offer a ‘code’ window at all if it takes what you write and reinterprets it?

    Yeah, you could hack the snot out of the core, but it’s going to be a pain to upgrade. Now, if you could roll your hack into a plugin, then you’d be in business.

    You mean this 2 row plugin by John Godley @ http://www.urbangiraffe.com/plugins/disable-wpautop?
    remove_filter ('the_content', 'wpautop');
    remove_filter ('comment_text', 'wpautop');

    Actually, that would probably work for part of it. I still don’t think you’ll get total HTML control, but it’s another big step in the right direction.

    Edit: If you enable it on a working blog, though, be prepared to “fix” all your old posts! I should have been a good webmaster and put the <p> tags in there to begin with, but autop made me lazy. :o\

    Thread Starter Darren

    (@cutout)

    The wpautop plugin seems to be working in conjunction with this fix. But — when I manually insert paragraph tags, WP/tinyMCE strips them. Aarrgh.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘WYSIWYG ignoring or reinterpreting HTML’ is closed to new replies.