Disable WordPress maintenance nag

In case of a WordPress multisite with a specific setup trying to run autoupdates, you could add the following to prevent the WordPress autoupdates:

[php]
define( ‘WP_AUTO_UPDATE_CORE’, false );
[/php]

Hiding the automatic update messages in dashboard for site users and single site admins, you could disable the nag actions:

[php]
add_action( ‘admin_init’, ‘dx_prevent_notifications’ );

function dx_prevent_notifications() {
if ( !current_user_can( ‘edit_users’ ) ) {
remove_action( ‘admin_notices’, ‘maintenance_nag’ );
remove_action( ‘network_admin_notices’, ‘maintenance_nag’ );
}
}
[/php]

Leave a Reply

Your email address will not be published. Required fields are marked *