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.
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”
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.
Hello David.
You could try replacing lines 14-16 with these.
if ( ! current_user_can( 'administrator' ) ) {
remove_all_actions( 'admin_notices' );
}
Worked like a charm!
Hi, excellent snippet, SO useful! thank you.
About this tweak to hide all notices, will it also hide “post updated” notices and such when user is saving a post or product? Thank you!
Yes, this should remove all notices.
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.
Hello.
You could try modifying the check from this StackOverflow post. You can set it to check if it’s not that particular user account viewing the page to then remove the action.
Can I use this snippet inside function.php? Not as a plugin.
Hello.
Yes, you can, however it’s preferable to use it in a plugin.