Disable the WordPress Upgrade Nag

I love WordPress – it’s awesome and it let’s me build fantastic and functional sites for my clients.

But I HATE that upgrade nag you get whenever a new release comes out.

Because invariably, one of my clients will log in, see the “WordPress 3.0 is available! Please update now.” message, and think that they are supposed to click the link. And you can guess the rest of the story… we’ll spend the next 2 hours restoring the site from backup because two of their critical plugins aren’t yet compatible with the latest version of WordPress.

As an aside, I’ve lately been using iTheme’s brilliant BackupBuddy plugin to copy client’s entire sites to a test domain to trial new plugins and generally test upgrades. Highly recommended – really makes transferring sites between domains a snap!

Anyway, I finally decided to bite the bullet and hide the upgrade nag message for everyone who is logged in to the site except for me.

Here’s the code I used – it goes in your theme’s functions.php file – or custom-functions.php if you’re using Thesis. Obvioulsy change the user name from “steve” to YOUR user name (check top-right corner of Admin dashboard – Howdy, xxxxx).

function hide_update_notice() {
 global $user_login , $user_email;
 if ($user_login != "steve") {
 remove_action( 'admin_notices', 'update_nag', 3 );
add_action( 'admin_notices', 'hide_update_notice', 1 );

I borrowed heavily from http://gunnerpress.com/wordpress/disable-non-admins-from-seeing-the-wp-version-update-notification and Yoast’s http://yoast.com/disable-update-nag/ in pulling this together. Thanks!

7 thoughts on “Disable the WordPress Upgrade Nag”

  1. Hey Steve,
    Which plugins are you using that are not yet compatible with WordPress 3.0?
    Do you recommend upgrading to WordPress 3.0 or sticking with WordPress 2.x?

  2. The one I had trouble with was PodCasting – I figured I’m not doing any podcasting yet, so I disabled and updated.
    Definitely worth upgrading to WP 3.x for your own sites. If you have clients on latest 2.9.x, then I’d go with “don’t rush to fix what ain’t broke” approach. Schedule it for some time in the future once all the inevitable bugs in 3.x have been found and fixed and then upgrade on a quiet weekend.

  3. Steve, how about updating your function to be a little more robust – base the visibility of the update notice on WordPress capabilities? current_user_can() is your friend in this situation.

Leave a Reply

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