Disable Wordpress update notification

Disable Wordpress update notification

Posted: 10 years ago in  PHP | Wordpress |


It is obviously that we want to keep our software/website up-to-date with cutting-edge technologies. The notification of new improvment is what developers give us. However, when you provide a package which combined from 3rd party components, it would be nice if those notifications turned off and replaced by your custom after-sale service :)


It is obviously that we want to keep our software/website up-to-date with cutting-edge technologies. The notification of new improvment is what developers give us. However, when you provide a package which combined from 3rd party components, it would be nice if those notifications turned off and replaced by your custom after-sale service :)

In this case, website built from Wordpress is an example. Wordpress, plugins and themes notification are what we want to hide from end-user. Why ? Because they are going to be updated after we hand out the sourcecode and it could make conflict with our themes, plugins and customizations. We hide them and only give update for user after your integration testing.

Here are steps to hide it from admin panel:

To disable wordpress core updates (e.g Wordpress 4.0 is available)

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');
}

To disable plugins update notification: add code to functions.php of active theme

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