X

Hide WordPress Update Nag within the Admin

Adding this snippet to the functions.php of your WordPress theme will hide the update nag that appears at the top of all admin pages when a new version of WordPress is released.


function remove_upgrade_nag() {
   echo '<style type="text/css">
           .update-nag {display: none}
         </style>';
}

add_action('admin_head', 'remove_upgrade_nag');

Comments  Leave a Reply

  1. There is no need for non administrators to see the nag. Adding a check for permissions like below is in my opinion a good way to remove the nag but still show it for the administrator(s), or those who are allowed to perform updates.

    function remove_upgrade_nag() {
    if( !current_user_can(‘update_core’) ) {
    echo ‘
    .update-nag {display: none}
    ‘;
    }
    }
    add_action(‘admin_head’, ‘remove_upgrade_nag’);

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!