As promised… I’m going to show how you going to disable the “upgrade wordpress” nags. For this tutorial, I’m using Wordpress 2.3.2 as my test subject. Also take note that this is a disabling method, not removal. I know this information is close to being useless, but since I know “the how to”, might as well I wrote it down.
Now that we are clear on the simple introduction, let start.
First of all, we are going to disable this nag….

Go to “wp-admin/includes” and open “update.php“.
Look for:
add_action( 'admin_notices', 'update_nag', 3 );
Now comment that line. The result should be like this.
//add_action( 'admin_notices', 'update_nag', 3 );
The thing about wordpress is that it uses Function() method to call out whatever needed to call out, so all we have to do is comment it and they’ll stop working. Easy huh? Not much hassle to begin with.
…anyway, save your file, don’t close it yet and refresh your admin page. The notification should be gone by now. Tadaa~
But wait, we are not done yet!!!
There is still the footer nag…

For this section, there’s two ways you can do it. Go back to your opened file ( update.php ) and look for:
add_filter( 'update_footer', 'core_update_footer' );
… and comment it.
Result would be:
//add_filter( 'update_footer', 'core_update_footer' );
By using this method, not only you remove the nag, you removed the Wordpress version message too.
So that leave us with the second method.
note: if you did the first method. Please undo it.
Look for this on update.php. It should be on line 17:
return sprintf( '| <strong>'.__( 'Your WordPress %s is out of date. <a href="%s">Please update</a>.' ).'</strong>', $GLOBALS['wp_version'], $cur->url );
…and replace it with:
return sprintf( '| ‘.__( ‘WordPress %s’ ).’‘, $GLOBALS['wp_version'], $cur->url );
Save the file and refresh to view the result.
The nag is gone…. Buy me a Coke, cause and you’re done editing.
This method still applicable for version 2.3.3. I’m not sure about the much more older version. I did not check them. While as maybe in the future version of wordpress, there might possibly be an upgrade to this file cause it stated “The admin side of our 1.0 update system” at the very beginning of update.php.
As I was writing this entry, I found another cool method to disable the Nag. And there not much editing involves. Surprisingly, all it takes is editing a single or two numeric digits, and you’re done.
I reserved this for tomorrow’s entry. |