Title: Editor removing HTML code
Last modified: August 19, 2016

---

# Editor removing HTML code

 *  Resolved [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/)
 * Hi, problem I had in the past coming back to haunt me. I’m not sure is 2.3 (the
   version I upgraded from) did this and I just didn’t notice, but…
 * I’ve created two HTML tags in my stylesheet:
 * `<imgl></imgl> / <imgr></imgr>`
 * They push images to the left and right of blog posts and allow text to flow round
   them with a small border. All simple enough. And they work, which is great.
 * The inbuilt editor doesn’t seem to take them into account when I add them on 
   the HTML tab then flick back to the WYSIWYG tab. What I’ve noticed (after editing
   an old post and republishing) is that if I load a page with this markup in, edit
   in WYSIWYG mode and republish, the aforementioned tags are stripped out.
 * Not an “end of the world” thing, but a pain having to go through and manually
   add all the tags again.
 * Anyone know of a solution?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/#post-789162)
 * 1. Don’t use non-standard html tags, instead use css classes applied to your 
   image tags.
 * 2. Never switch back and forth between the visual and code editor, doing this
   will only mangle your code.
 *  [blueshift9](https://wordpress.org/support/users/blueshift9/)
 * (@blueshift9)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/#post-789165)
 * I thought i’d seen everything but making your own html tags? Now that’s just….
   uhhh.
 * Wow.
 *  Thread Starter [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/#post-789214)
 * Hey people.
 * Yeah, the tags thing was kind of the only way I could get the pictures to do 
   what I wanted. They are part of the style sheet, and are an adaptation of the“
   IMG” tag within a certain style. Pardon my lack of the correct terms! I’m more
   the kind of person who delves into code and messes with it than reads books on
   how to do it properly 😉
 * Ideally, I’d just use parameters in the standard img tags, but I found this to
   be the easiest way. You’re right, though – perhaps if I used a class within the
   img then the editor wouldn’t strip stuff out.
 * Thing is, I can’t avoid popping between the two tags as my spellchecker (Firefox)
   will only function in the WYSIWYG tab, while I need to manually alter HTML from
   time to time. I did have a glance around after I posted this and eventually did
   find a few people with similar problems with the visual editor “tidying” code
   when it wasn’t required.
 * I used to have nightmares with v2.3 and it’s wholesale destruction of “table”
   elements.
 * But, yeah. I should look more into using a “class” rather than a wholesale new“
   img” wrapper.
 *  Thread Starter [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * (@iainpurdie)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/#post-789219)
 * Just done my first major post after upgrading to 2.5.1 – and the left/right align
   in the image editor seems to do just what I want. I can now ditch the old imgl/
   imgr. Could mean a large editing session at some point to “correct” the old ones,
   bug looks like future posts will be a lot easier – and it gets rid of this problem(
   at least in this instance).
 * Yay! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Editor removing HTML code’ is closed to new replies.

## Tags

 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [format](https://wordpress.org/support/topic-tag/format/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [markup](https://wordpress.org/support/topic-tag/markup/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [IainPurdie](https://wordpress.org/support/users/iainpurdie/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/editor-removing-html-code/#post-789219)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
