Title: Custom code being stripped from PHP
Last modified: February 8, 2022

---

# Custom code being stripped from PHP

 *  Resolved [paulronto](https://wordpress.org/support/users/paulronto/)
 * (@paulronto)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/)
 * I’ve just noticed that custom code I’ve added to my Functions and Header PHP 
   was stripped out, I assume in a wordpress/theme update??
 * But these are crucial, like my Google Tag Manager code was removed, which holds
   my analytics code.
 * Also some custom styling in my Functions file…
 * Why would this happen, and how do I ensure it doesn’t happen in the future. Do
   I need to turn off automatic theme and WordPress updates? Is there an issue there
   with security or other site functions if I turn those updates off?
 * Thanks.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-code-being-stripped-from-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [paulronto](https://wordpress.org/support/users/paulronto/)
 * (@paulronto)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15342459)
 * Can I use any of these in my wp-config.php to solve this problem?
 * Wordpress core updates:
    define( ‘WP_AUTO_UPDATE_CORE’, false );
 * Plugins
    add_filter( ‘auto_update_plugin’, ‘__return_false’ );
 * Theme
    add_filter( ‘auto_update_theme’, ‘__return_false’ );
 * Would I just need to turn off the theme updates to ensure this code is not pulled
   out again? Any risk of things not working if the theme is not automatically updated?
 *  [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * (@luciamarinescu)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15356027)
 * Hi [@paulronto](https://wordpress.org/support/users/paulronto/)!
 * The changes made in the theme files are overwritten with each update of the theme.
   We always recommend our users to make these kind of changes only using a child
   theme, so the changes won’t be lost with future updates. You can find out how
   to create a child theme [here](https://docs.themeisle.com/article/985-how-to-create-a-child-theme-for-neve).
 * Have a nice day!
 *  Thread Starter [paulronto](https://wordpress.org/support/users/paulronto/)
 * (@paulronto)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15356574)
 * Thanks, I kept hearing about child themes, but I didn’t know what they were or
   what they did. I will see if I can figure this out without deleting my site… 
   That’s my luck recently.
 *  Thread Starter [paulronto](https://wordpress.org/support/users/paulronto/)
 * (@paulronto)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15356646)
 * Ok looks like i was able to download and install the child theme, now what?
 *  [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * (@luciamarinescu)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15379551)
 * Hello [@paulronto](https://wordpress.org/support/users/paulronto/)!
 * After installing and activating the child theme, you should locate the “views”
   folder inside Neve (in the root of the folder) and copy it inside the child theme’s
   folder. Then, you can make any changes you need in the views folder of the child
   theme. Also, make sure you save the changes. Please note that at the moment it’s
   possible to make changes within the child theme only for files that can be found
   inside that “views” folder.
 * Have a nice day!

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

The topic ‘Custom code being stripped from PHP’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/neve/4.2.4/screenshot.png)
 * Neve
 * [Support Threads](https://wordpress.org/support/theme/neve/)
 * [Active Topics](https://wordpress.org/support/theme/neve/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/neve/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/neve/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/custom-code-being-stripped-from-php/#post-15379551)
 * Status: resolved