Block updates by Server

Blocking the server from your hosts to prevent auto updating won’t hide notifications in the back office.

You have to add some code in your functions.php file.

The answer you are looking for is perfectly explained here

You should add these 3 portions of code at the bottom of you functions.php file :

The first one will disable wordpress core update notifications :

add_action('after_setup_theme','remove_core_updates');
function remove_core_updates()
{
 if(! current_user_can('update_core')){return;}
 add_action('init', function(){remove_action( 'init', 'wp_version_check' )}),2); //Thanks to Pieter Goosen, don't use create_function() as described in the link above
 add_filter('pre_option_update_core','__return_null');
 add_filter('pre_site_transient_update_core','__return_null');
}

The second one will prevent plugins update notifications :

remove_action('load-update-core.php','wp_update_plugins');
add_filter('pre_site_transient_update_plugins','__return_null');

Finally, you still need to tell wordpress to use the “remove_core_updates” functions on several actions by adding this last piece of code :

function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates');
add_filter('pre_site_transient_update_plugins','remove_core_updates');
add_filter('pre_site_transient_update_themes','remove_core_updates');

Leave a Comment