Hide the WordPress Update Nag
Sometimes in developing themes and really cool functionality for clients' Wordpress websites you'll find yourself in a situation where updating Wordpress automatically is a REALLY bad idea. Maybe you toss and turn at night just thinking about what would happen if they click that little upgrade nag link at the top and it takes the whole site down--for hours. Chill. Here are two ways to hide the Wordpress update nag.
Sometimes in developing themes and really cool functionality for clients’ WordPress websites you’ll find yourself in a situation where updating WordPress automatically is a REALLY bad idea. Maybe you toss and turn at night just thinking about what would happen if they click that little upgrade nag link at the top and it takes the whole site down–for hours. Chill. Here are two ways to hide the WordPress update nag. It doesn’t really matter which way you choose. I prefer the CSS technique, but the PHP one is fine too. The trick in either case is to be able to revert back easily. Please keep in mind that modifying core WordPress files is anything but a best practice, but if you must, here’s how.
[box type=”error” size=”large”]MAKE A BACKUP BEFORE EVEN READING THE FOLLOWING[/box]
The CSS Route
- Locate the admin style sheet you’re using. It’s likely here:
/wp-admin/css/colors-fresh.css
. - On the very first line of the CSS stylesheet, you’ll find:
#update-nag, .update-nag
- Just display:none; that class and ID and whalla!
As an example, that would look like: #update-nag, .update-nag{display:none;}
, but you can leave the rest of the styling alone. It’s also a good idea to put some sort of comment reminder nearby so you can un-hide it when you’re ready to do the upgrade a little more carefully.
The PHP Route
- Locate and open:
/wp-admin/includes/update.php
. - Somewhere around line 139 you’ll find:
add_action( ‘admin_notices’, ‘update_nag’, 3 );
- Just comment out that line:
// add_action( ‘admin_notices’, ‘update_nag’, 3 );
- Re-upload the file and the notice is gone.
It’s a good idea not to delete the line. By simply commenting it out the server will skip over it and you can simply un-comment it out when you’re ready to upgrade WordPress yourself.
Final Thoughts…
WordPress upgrades are very important for a variety of reasons, from security to usability and from new features to SEO, but we get it… A WordPress update nag out of sight is out of mind.
Get the Email
Join 1000+ other subscribers. Only 1 digest email per month. We'll never share your address. Unsubscribe anytime. It won't hurt our feelings (much).
Discussion
Comments are now closed.
Notice: Trying to access array offset on value of type null in /home2/justin/public_html/wp-content/plugins/wp-invoice-quotes/lib/class-wp-invoice-quotes.php on line 413