If you gave wp-admin access to some users as editor or contributor etc, they will see those update WordPress notices, even though they can’t perform the update. This is not very comprehensive behavior. So we are going to turn off update notices for non-admin users from wp-admin dashboard by removing update_nag
action from admin_notices
. We will also remove core_update_footer
from update_footer
.
function careless_hide_admin_notice_from_non_admin_users() {
if ( !current_user_can( 'update_core' ) ) {
remove_action( 'admin_notices', 'update_nag', 3 );
remove_filter( 'update_footer', 'core_update_footer' );
}
}
add_action( 'admin_head', 'careless_hide_admin_notice_from_non_admin_users', 1 );
Code goes in the functions.php
file of your active theme.
If you want to hide all wp-admin notices, follow this article.