Title: &#8220;automatically deactivated&#8221;
Last modified: August 13, 2023

---

# “automatically deactivated”

 *  Resolved [JapeNZ](https://wordpress.org/support/users/japenz/)
 * (@japenz)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/automatically-deactivated/)
 * Hi there,
 * I have a four snippets that are being automatically deactivated, but I can’t 
   work out why.
 * I’m seeing a lot of these in my error log:
 * > Attempt to read property “post_type” on null
 * And I’m wondering if that might be the issue?
 * One of the snippets is the disable automatic updates, I have no idea why that
   would be automatically deactivated:
 * `// Disable core auto-updates
   add_filter( 'auto_update_core', '__return_false');//
   Disable auto-updates for plugins.add_filter( 'auto_update_plugin', '__return_false');//
   Disable auto-updates for themes.add_filter( 'auto_update_theme', '__return_false');
 * Any suggestions would be very much appreciated!

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

 *  Plugin Author [Mircea Sandu](https://wordpress.org/support/users/gripgrip/)
 * (@gripgrip)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/automatically-deactivated/#post-16970128)
 * Hi [@japenz](https://wordpress.org/support/users/japenz/),
 * The snippets are getting deactivated as they are generating an error or notice
   you can read more about how that system works in [this article](https://wpcode.com/docs/php-error-handling-safe-mode/).
 * Due to the way the code is dynamically executed in PHP snippets in WPCode multiple
   snippets may get deactivated but the one that is causing the issue in your case
   is the one trying to use “post_type” on a null value.
 * To quickly identify the snippet causing the original issue you can use the search
   in the list of WPCode code snippets to search for “post_type” and that should
   help you narrow it down at least and then you can add checks in place to avoid
   the error. More info on how to identify errors and attempt to fix them can be
   found here: [https://wpcode.com/docs/how-to-debug-php-errors-in-wpcode/](https://wpcode.com/docs/how-to-debug-php-errors-in-wpcode/)
 * If you need help debugging this further please reach out using the form at [https://wpcode.com/contact](https://wpcode.com/contact)
 *  Thread Starter [JapeNZ](https://wordpress.org/support/users/japenz/)
 * (@japenz)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/automatically-deactivated/#post-16972950)
 * Hi [@gripgrip](https://wordpress.org/support/users/gripgrip/),
 * Thank you for getting back to me!
 * I was able to find the snippet that was causing the error by searching for “post_type”,
   then deactivating and reactivating them until the culprit was discovered!
 * Awesome support, very much appreciated 🙂

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

The topic ‘“automatically deactivated”’ is closed to new replies.

 * ![](https://ps.w.org/insert-headers-and-footers/assets/icon-256x256.png?rev=2758516)
 * [WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager](https://wordpress.org/plugins/insert-headers-and-footers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-headers-and-footers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-headers-and-footers/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-headers-and-footers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-headers-and-footers/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [JapeNZ](https://wordpress.org/support/users/japenz/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/automatically-deactivated/#post-16972950)
 * Status: resolved