Title: WordPress Editor changes PHP code on Save
Last modified: June 6, 2017

---

# WordPress Editor changes PHP code on Save

 *  [dccharron](https://wordpress.org/support/users/dccharron/)
 * (@dccharron)
 * [9 years ago](https://wordpress.org/support/topic/wordpress-editor-changes-php-code-on-save/)
 * Love this plugin. Thank you.
 * Most annoyed at behaviour of WP editor. It changes and removes some characters
   from my inserted PHP code. Makes life difficult (impossible?).
 * Most recent case:
 * I’m trying to use the PHP condition
    `<=` but WP editor changes it to `< =` which
   generates a PHP syntax error.
 * Another example, if I use the PHP condition
    `<` in my code, WP editor removes
   the next instance of `</a>` completely that happens to follow it in the PHP code
   even though it is part of a string expression.
 * Is there some way to configure the WP editor to stop doing this? Sometimes WordPress
   makes me think I need to move to another platform which isn’t so overprotective.
    -  This topic was modified 9 years ago by [dccharron](https://wordpress.org/support/users/dccharron/).

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

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [9 years ago](https://wordpress.org/support/topic/wordpress-editor-changes-php-code-on-save/#post-9201804)
 * Hi (love your photo).
 * It shouldn’t be doing that.
 * Verify you’re using the “Text” tab instead of the “Visual” when editing. If that’s
   not the reason, there may be a plugin that’s interfering; they can be tested 
   by temporarily deactivating each in turn.
 * If your PHP code can run outside the WordPress environment, consider uploading
   them as stand-alone scripts and then using the Insert Here plugin ( [http://www.willmaster.com/software/WPplugins/insert-here-wordpress-plugin.php](http://www.willmaster.com/software/WPplugins/insert-here-wordpress-plugin.php))
   to publish their output.
 * Will
    -  This reply was modified 9 years ago by [WillBontrager](https://wordpress.org/support/users/willbontrager/).
    -  This reply was modified 9 years ago by [WillBontrager](https://wordpress.org/support/users/willbontrager/).
 *  Thread Starter [dccharron](https://wordpress.org/support/users/dccharron/)
 * (@dccharron)
 * [9 years ago](https://wordpress.org/support/topic/wordpress-editor-changes-php-code-on-save/#post-9203614)
 * Many thanks for taking the time to reply.
 * (My avatar is a photo of me circa 1953 – hence the black and white)
 * Definitely using “Text” editing mode so that’s not the issue.
 * The problem is happening on a live commercial website (which makes it a bit hard
   to test on/off of each plugin in turn) and uses your plugin extensively to do
   some fancy things. As it turns out, I’ve recently built a copy of the website
   in French and German that aren’t “live” yet so I’ll try duplicating the problem
   on one of those sites and let you know of my progress.
 *  Thread Starter [dccharron](https://wordpress.org/support/users/dccharron/)
 * (@dccharron)
 * [9 years ago](https://wordpress.org/support/topic/wordpress-editor-changes-php-code-on-save/#post-9203655)
 * Just a follow up. Having a look at your “insert here” plugin. Looks very promising.
   Will try it out and let you know.

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

The topic ‘WordPress Editor changes PHP code on Save’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [dccharron](https://wordpress.org/support/users/dccharron/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/wordpress-editor-changes-php-code-on-save/#post-9203655)
 * Status: not resolved