WordPress Snippets

Code Snippet

Though you may have the auto updates to themes and plugins individually turned off, sometimes installing a new plugin turns it on for that plugin. Or, sometimes you may have another admin that turns on specific auto updates, but you would rather they not do so.

The toggle for turning on/off auto updates for themes and plugins can be disabled completely, also disabling auto updates.

So why turn off auto updates? Many admins like to manually do theme and plugin updates after thorough testing, especially if you have a highly-visited site with lots of plugins.

PHP

Place the following code anywhere in your child theme’s functions.php document.

// prevent auto updates of plugins and themes
add_filter( 'auto_update_plugin', '__return_false' );
add_filter( 'auto_update_theme', '__return_false' );

However, make sure you continue doing those updates manually.

Keeping everything up to date is necessary to prevent security issues, or just to prevent things from getting out of date and eventually breaking.

Note

All modifications to a theme or plugin should be made by creating a child theme and placing the changes there. Changes made to the parent theme will be overwritten the next time it updates.


WordPress Notes:

  • All modifications to a theme or plugin should be made by creating a child theme and placing the changes there; changes made to the parent theme will be overwritten the next time it updates

We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.