How to hide the WordPress update message

On aspect when developing sites for clients is how to handle updates of WordPress and plugins. Should you let your clients do this themselves or should you offer that as a service?

WordPress has a built in function that will let you know when there is a new version that you can update to. A message like the one in the image will be displayed to the user prompting to update.

WordPress Update Message

WordPress Update Message

If your clients are doing the updates themselves, this is a great function for reminding them. However, if you are doing the updates for the clients this can cause trouble for you if they click on the message and attempt to do the update. Of course they can manage to complete to update successfully but sometimes they can get in to trouble and have forgotten to do a proper backup.

There is a easy solution for this. Just put this simple code in your functions.php and the update message will be hidden.

function hideUpdateNag() {
	remove_action( 'admin_notices', 'update_nag', 3 );
}
add_action('admin_menu','hideUpdateNag');

You can optionally put this code with a condition so that the update message will only be shown to the site admin or other user roles depending of the if-statement in the code snippet below.

function hideUpdateNag() {
	remove_action( 'admin_notices', 'update_nag', 3 );
}
if ( !current_user_can('activate_plugins') ) {
	add_action('admin_menu','hideUpdateNag');
}

About Fredrik Malmgren

Fredrik Malmgren is an entrepreneur, project manager and developer specialized in WordPress. Read more about me or get in contact with me. You can also find me on Twitter. (@fredrikmalmgren).
This entry was posted in Tutorials, WordPress and tagged , . Bookmark the permalink.

5 Responses to How to hide the WordPress update message

  1. Pingback: Ultimate Guide to Update WordPress [Infographic] | Fredrik Malmgren

  2. Stuart says:

    Just what I needed thanks!

  3. Pingback: WordPress Arena: A Blog for WordPress Developers, Designers and Blogger

  4. Pingback: Script Installation Service

  5. Pingback: WordPress: How do you remove WordPress admin messages? - Quora

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>