Title: WordPress, stop removing my HTML code!
Last modified: August 19, 2016

---

# WordPress, stop removing my HTML code!

 *  Resolved [sweyhrich](https://wordpress.org/support/users/sweyhrich/)
 * (@sweyhrich)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/)
 * I’ve been including the HTML code from my Amazon Affiliate lookup at the end 
   of posts that I make to my WordPress site. I switch from “Visual” to “HTML”, 
   enter the code (enclosed between <div> tags), and save it. But if I switch back
   to “Visual”, make other edits, and then save it again, the Amazon <iframe> data
   between those <div> tags disappears. If I save it in HTML mode and don’t mess
   with anything again, it will stick.
 * How can I make WP stop removing code I’ve specifically put in?

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

 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-874657)
 * Switching back and forth between the visual and html editors will mangle your
   code. The visual editor is _not_ a preview tool and is _only_ meant for people
   who do not want to add their own code. If you will be adding any code, disable
   the visual editor by deselecting “Use the visual editor when writing” in your
   profile.
 *  [Technokinetics](https://wordpress.org/support/users/technokinetics/)
 * (@technokinetics)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-874693)
 * This is one of the (few) things about WordPress that could do with some work 
   for future releases. I share your frustration (but can’t help, sorry).
 *  Thread Starter [sweyhrich](https://wordpress.org/support/users/sweyhrich/)
 * (@sweyhrich)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-874698)
 * Ah, so it’s not just a failure to understand some rules. Thanks for the information.
 * Until I know better how to enter some code for my posts, I’ll have to continue
   to use the Visual editor, and then just leave it in HTML mode when I’ve got the
   heavy lifting done and I’m back in familiar territory, HTML-wise.
 *  [mahalie](https://wordpress.org/support/users/mahalie/)
 * (@mahalie)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-875061)
 * TFG, this was making me crazy. In my case I write a lot of code examples and 
   was trying to get some inline javascript to work.
 * I already use the WP Unformatted plugin to prevent smart-quotes and automatic
   formatting to screw things up.
 * Finally figured out it was WP trying to help:
    Settings > Writing > Uncheck _WordPress
   should correct invalidly nested XHTML automatically_
 *  [ArcherTC](https://wordpress.org/support/users/archertc/)
 * (@archertc)
 * [17 years ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-875088)
 * I already have this unchecked and I cannot insert the iFrame code from Amazon.
   Really, this is nuts.
 *  [tracyberna](https://wordpress.org/support/users/tracyberna/)
 * (@tracyberna)
 * [17 years ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-875091)
 * Right there with you. I’m trying to set up pages for clients to edit on their
   own once the site is done. I can’t do it if editing in Visual mode strips the
   code, because the whole reason I’m using WP in these cases is that the clients
   are noobs who can’t code a lick. They’re undoubtedly going to use the Visual 
   editor. If there was a workaround for this I would ADORE it, because it would
   open up so many more formatting possibilities and save me the time spent trying
   come up with my own. It absolutely needs to be solved in future releases.

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

The topic ‘WordPress, stop removing my HTML code!’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [xhtml](https://wordpress.org/support/topic-tag/xhtml/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 6 participants
 * Last reply from: [tracyberna](https://wordpress.org/support/users/tracyberna/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/wordpress-stop-removing-my-html-code/#post-875091)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
