Stop WordPress auto updates for plugins and core: no plugin needed

Just some simple code to prevent WordPress from notifying about updates for plugins or WordPress’ core. No plugin needed!

We use this snippet on every site we build so that the client doesn’t auto update a plugin or the WordPress core without first testing. Updates are great, but if you don’t have a proper testing environment to ensure the update of the plugin or WordPress’ core won’t break the site, it’s a good idea to prevent the client from auto-updating and potentially breaking things. Just drop this in the theme’s functions.php file and bada bing – no more notifications.

// stop wp notice to update core
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
// stop wp notice to update plugins
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

No Comments

Leave a Reply

To include code, just include it in [code] [/code] square brackets. Sweet.