WordPress.org

Ready to get started?Download WordPress

Forums

HTML code dissappears in Editor (4 posts)

  1. LesTexas60
    Member
    Posted 6 months ago #

    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.

  2. LesTexas60
    Member
    Posted 6 months ago #

    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 http://wordpress.org/plugins/raw-html/
    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.

  3. webbrewers
    Member
    Posted 6 months ago #

    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.

  4. LesTexas60
    Member
    Posted 6 months ago #

    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.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.