Title: PHP code keeps being deleted
Last modified: January 15, 2021

---

# PHP code keeps being deleted

 *  [rycom](https://wordpress.org/support/users/rycom/)
 * (@rycom)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-code-keeps-being-deleted/)
 * Hi
 * At random and for no reason I can see several pages on this website lose their
   php code from the PHP Everywhere box on the right hand side.
 * I am running Wordfence but cannot find anything about codes being deleted. I 
   see several other topics regarding this but none of them have answers and are
   closed.
 * Can you please help with this issue?
 * Paul
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-code-keeps-being-deleted%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [rycom](https://wordpress.org/support/users/rycom/)
 * (@rycom)
 * [5 years ago](https://wordpress.org/support/topic/php-code-keeps-being-deleted/#post-14434766)
 * Why don’t you respond to any support issues?
 *  [jrggv](https://wordpress.org/support/users/jrggv/)
 * (@jrggv)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-keeps-being-deleted/#post-14947361)
 * I might have been having the same problem as you, so here’s what I found I had
   to do to fix it.
    I have pages with working php_everywhere code embedded, and
   I’ve been trying to update the embedded code. I can edit it on the page, and 
   hit the ‘update’ button for the plugin, and the change appears to work – but 
   when I save the changes to the page and view it, the original code is back. After
   a LOT of testing, I worked out that the changed PHP code was being written to
   the database correctly, and then being rewritten back to the previous version
   when the page was saved. This might have been cause by Wordfence, which is also
   running on the server. Try creating a new page with a php_everywhere plugin that
   just says <?php require_once(‘someFile.php’); ?> and create a file called someFile.
   php in the wordpress directory on your server. Then edit that file. In a worst
   case, find your site’s blog ID in wordpress, and go to the database. For a site
   with ID=2, you want to edit data in the table wp_2_postmeta. Look for a row with
   meta_key=php_everywhere, and edit the meta_value. It’s a very clunky workaround,
   but it works for me.

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

The topic ‘PHP code keeps being deleted’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-everywhere_5f7aae.svg)
 * [PHP Everywhere](https://wordpress.org/plugins/php-everywhere/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-everywhere/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-everywhere/)
 * [Active Topics](https://wordpress.org/support/plugin/php-everywhere/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-everywhere/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-everywhere/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jrggv](https://wordpress.org/support/users/jrggv/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/php-code-keeps-being-deleted/#post-14947361)
 * Status: not resolved