Use the coupon code WORDPRESS and save 30% OFF! Buy Now

Hide the WordPress update notifications from all users except administrators

Last Updated On
Hide the WordPress update notifications from all users except administrators WordPress template

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.

9 responses to “Hide the WordPress update notifications from all users except administrators”

  1. David Brabyn says:

    Any tips on how to extend this to all notifications beyond just updates — like plugins ads, up-sells and sign up forms? Non-admins don’t need to see these.

  2. Uldis says:

    Is there a way to show notifications to a specific user only? I’d like to be the only one to see them. I don’t want all the Admins from the client-side to keep asking me if I noticed the notification. It is not helpful for them, and only matters to me. Thanks.

  3. Can I use this snippet inside function.php? Not as a plugin.

Leave a Reply

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

Get access to all WordPress themes & plugins

24/7 Support Included. Join 115,000+ satisfied customers.

Pricing & Sign Up

30-day money-back guarantee. Not satisfied? Your money back, no questions asked.

Back to top