25% off ProSNIPC25OFF

Hide Admin Update Notifications (Keep Emails)

Suppresses core, plugin, and theme update nags in the WordPress dashboard for users who cannot perform updates, while leaving background email alerts intact.

PHPby SnipCraft
php
<?php
if ( ! function_exists( 'scseed_hide_update_nags' ) ) {
    function scseed_hide_update_nags() {
        // Only hide nags for users who cannot actually run updates.
        if ( current_user_can( 'update_core' ) ) {
            return;
        }
        // Remove the "WordPress X.Y.Z is available" admin notice.
        remove_action( 'admin_notices',         'update_nag', 3 );
        remove_action( 'network_admin_notices', 'update_nag', 3 );

        // Hide the update count bubbles on Plugins and Themes menu items.
        add_filter( 'site_transient_update_plugins', '__return_null' );
        add_filter( 'site_transient_update_themes',  '__return_null' );
        add_filter( 'site_transient_update_core',    '__return_null' );

        // Remove the "Get Version X.Y.Z" footer text.
        add_filter( 'update_footer', '__return_empty_string', 99 );
    }
    add_action( 'admin_init', 'scseed_hide_update_nags' );
}
#admin#cleanup#notifications#roles#updates