• Home
  • About
  • Projects
  • Blog
  • Contact

Disable Update and Maintenance Notifications WordPress

wordpress-update-notifications

For all the WordPress clients, it is truly irritating when WordPress update notification is shown on the dashboard if there are any update accessible for WordPress.
The notification won’t clear until the WordPress is moved up to most recent version. Likewise the upgrade notification for plugins and themes is shown on the WordPress dashboard, plugins and themes pages. It is really good and useful to know when a new update is released, but there are times in which some people (eg. clients) may not need to be able to see these new notifications on their dushboard. Then the disabling comes in handy.

Embed one of the following accompanying codes in your functions.php file. The options you have to choose from are regarding the level of notifications you would like to disable:

Disable Update WordPress

add_action('after_setup_theme','remove_core_updates');
function remove_core_updates()
{
if(! current_user_can('update_core')){return;}
add_action('init', create_function('$a',"remove_action( 'init', 'wp_version_check' );"),2);
add_filter('pre_option_update_core','__return_null');
add_filter('pre_site_transient_update_core','__return_null');
}

Disable Plugin Update Notifications

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

Disable all the Nags & Notifications

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');
If you find my blogging useful, say hi.

copyright © 2015-2021 Ivelin Iliev