Enable update notification, disable updates

Add the following code in your child theme’s functions.php or package it as a custom plugin to easily enable/disable:

add_action( 'wp_before_admin_bar_render', 'wpse161696_toolbar_menu' );
add_action( 'admin_menu', 'wpse161696_updates' );

function wpse161696_toolbar_menu() { // Remove update menu item from the toolbar
    global $wp_admin_bar;
    $wp_admin_bar -> remove_menu( 'updates' );
}

function wpse161696_updates() { // Remove all updating related functions
    remove_submenu_page( 'index.php', 'update-core.php' ); // Remove Update submenu
    // Redirect to Dashboard if update page is accessed
    global $pagenow;
    $page = array(
        'update-core.php',
        'update.php',
        'update.php?action=upgrade-plugin'
        );
    if ( in_array( $pagenow, $page, true ) ) {
        wp_redirect( admin_url( 'index.php' ), 301 );
        // wp_die( 'Updates are disabled.' ); // An error message can be displayed instead
        exit;
    }
}

This should give you something to work with. It removes the update links from the sidebar and toolbar in the Dashboard while leaving the update notifications on.

However, the update now will still show under each plugin which would allow the user to perform updates:

enter image description here

A solution to this is to hide the link via CSS. I couldn’t quite get that part working, but given that this question is very old, I didn’t want to waste time on it either. I felt this question needed some closure to it.

Leave a Comment