Support » Fixing WordPress » HTML code dissappears in Editor

  • I just spent about 3 hours reading posts about this problem. They go back as far as 2006 or sooner. It appears that if you add HTML in the Text mode and then go to the Visual mode, The Editor will delete the code if it doesn’t know how to render it. All these updates and all these years would suggest someone has fixed this problem. The only solution offered was pick HTML and stay with that. If we were going to stay with HTML code, why would we use WordPress in the first place? There has to be a way to encase code so it’s not affected by the editor. Has anyone figured this one out? I have yet to find any new posts about this problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • For those that may need help on this one I did find 2 solutions.
    1. You can add the <![CDATA[ command after your HTML line that keeps disappearing. I put mine right before the end Script command.

    2. There is a plugin at
    that lets you add ‘Raw” around code you don’t want affected by the editor.

    Good luck, this worked for me but it would be a nice addition for the basic WP.

    I’d just add this only seems to happen in certain cases so it could be theme or plug in or even host related. The recommended plug in is “Preserved HTML Editor Markup” which for the one or 2 times I’ve noticed it, has done the job.

    To webbrewers; The key seems to be if the Editor can render the code you have entered. If the Editor scans the code and does not understand it, the code is deleted. I’ve run into this more often when using Iframes accessing external URL’s. Thank you for the suggested Plug In.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HTML code dissappears in Editor’ is closed to new replies.