Title: Stop visual editor from changing code
Last modified: August 30, 2016

---

# Stop visual editor from changing code

 *  [benwalsh](https://wordpress.org/support/users/benwalsh/)
 * (@benwalsh)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/)
 * When one switches from the text to the visual editor code is rewritten.
 * I have some links code like the following:
    `<a href="JavaScript:newPopup('http://
   www.etc');"` and this this to be unchanged can anyone please tell me how to achieve
   this or suggest another way of coding these pop ups

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876388)
 * Don’t switch. Basically, WordPress expects you to either write html or to write
   plain text with formatting in the visual editor. Not both.
 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876395)
 * Also, depending what kind of code blocks (usually to show example code snippets),
   you have to disable the visual editor in the profile completely to keep it from
   monkeying around with it when you update/publish the post.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876400)
 * If you are writing code snippets, also consider using a plugin like Syntax Highlighter
   which mostly solves this for you in the process.
 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876503)
 * I’ve been using WP Syntax. Not sure how trying a different one would jack up 
   my old posts due to CSS changes etc.
 *  Thread Starter [benwalsh](https://wordpress.org/support/users/benwalsh/)
 * (@benwalsh)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876524)
 * THANX All
    I am only the webmaster (I am not completely happy with that term)
   and the business owner also edits pages but with the visual editor and each time
   he updates I have to recode the pop ups that I argued against in the first place,
 *  [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876526)
 * Try this plugin: Anything Popup ([https://wordpress.org/plugins/anything-popup/](https://wordpress.org/plugins/anything-popup/)).
   
   Read what it does here: [http://www.gopiplus.com/work/2012/05/25/wordpress-popup-plugin-anything-popup/](http://www.gopiplus.com/work/2012/05/25/wordpress-popup-plugin-anything-popup/)

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

The topic ‘Stop visual editor from changing code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 4 participants
 * Last reply from: [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/stop-visual-editor-from-changing-code/#post-6876526)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
