Hide the WordPress update notifications from all users except administrators

Between minor and major releases, WordPress is regularly updated with new features, improvements on existing ones, security fixes and more. If you have automatic updates enabled on your site, minor releases are downloaded and installed silently without requiring any action from the site’s administrator. However this is not the case for major releases. Once a major release is out a prompt will appear in the WordPress dashboard letting you know that there is a new major update available for your site urging you to install it.

This notification might be annoying in some cases. For example if you are a developer managing many client sites. Depending on the amount of custom work on each site, or the plugins installed, you will often, if not always, need to first do the update on a staging server to see if everything works as it should, before pushing the update to the live site. This process might take some time which means that clients/users might see this update notification and start asking why are you not doing your job keeping their site up to date, and if you manage many sites, answering questions like this one might take up precious time away from the actual update process. In order to avoid this problem we’re going to create a small plugin that hides the update notification from all users except ones with administrator privileges.

The plugin

Create a new folder under the wp-content/plugins folder of your installation and name it hide-update-notification or something similar. Inside it create a file called hide-update-notification.php or something similar. Inside the file paste this code.

<?php
/**
 * Plugin Name: Hide Update Notifications
 * Plugin URI: https://cssigniter.com
 * Description: A small plugin to hide WordPress core update notifications from all users except administrators.
 * Version: 1.0
 * Author: cssigniter
 * Author URI: https://cssigniter.com
 * License: GPLv2 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 */

function hide_core_update_notifications_from_users() {
	if ( ! current_user_can( 'update_core' ) ) {
		remove_action( 'admin_notices', 'update_nag', 3 );
	}
}
add_action( 'admin_head', 'hide_core_update_notifications_from_users', 1 );
Hide WordPress update notifications from users.

Save the file and activate the plugin from your WordPress dashboard.

That’s it!

The core update notification is now hidden from all user roles, except the administrator one. Hopefully you found this guide useful. Have you got any ideas on topics you’d like to see discussed on our blog? Let us know in the comments below.

Subscribe to our newsletter

Receive freebies, news & updates straight into your inbox.

By entering your email, you agree to our Terms of Service and Privacy Policy.

Leave a Reply

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