How to Hide the WordPress Upgrade Message in the Dashboard
When you have built your site on an open source project like WordPress one of the benefits you get is continuous updates and improvements to the core code.
WordPress aims to release a couple of versions per year, when there is a new version of WordPress available to download there will be a notification bar at the top of your admin area. This notification bar will let you know that your WordPress version is out of date and that you need to update the core code.
The problem with this is when updating on a live site, without knowing the affects of the update. With each release WordPress is trying to improve it's codebase, this could mean that it will improve on old functions of code or even remove old functions of code.
If you have a plugin or theme that is using any of these old deprecated functions then it could break the functionality of your site or even bring down your entire site.
The WordPress update notification is shown to all users, but there is a different message depending on your access rights.
Depending on how your site is setup you might not want to show all users that you are running an out of date WordPress version and want to hide the fact that an update is available.
Use the following code to hide the update message to all users except Admin users
There are plugins available that does this job, but we prefer to use the code above. Now remember, this only removes the upgrade bar that shows on all screens. It does not disable the Plugin updates or theme update notifications that shows up on the update page. For our clients that have us do the maintenance for them, we make sure that their site is up to date with all plugins, and the core.
Depending on how your site is setup you might not want to show all users that you are running an out of date WordPress version and want to hide the fact that an update is available.
Use the following code to hide the update message to all users except Admin users
Simply add above code to your functions.php file and click save and the notices will disappear.
- add_action('admin_menu','wphidenag');
- function wphidenag() {
- remove_action( 'admin_notices', 'update_nag', 3 );
- }
There are plugins available that does this job, but we prefer to use the code above. Now remember, this only removes the upgrade bar that shows on all screens. It does not disable the Plugin updates or theme update notifications that shows up on the update page. For our clients that have us do the maintenance for them, we make sure that their site is up to date with all plugins, and the core.


0 comments: