In WordPress we can remove update notifications from all users except specific roles, by username or by user ID. Below you can find a few examples that you can insert into your functions.php file.

By role

add_action('admin_head', function() { if(!current_user_can('manage_options')){ remove_action( 'admin_notices', 'update_nag', 3 ); remove_action( 'admin_notices', 'maintenance_nag', 10 ); } });
Code language: JavaScript (javascript)

By username

global $user_login; get_currentuserinfo(); if ($user_login !== "joe") { // change joe to the username that gets the updates add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); }
Code language: PHP (php)

By user ID

global $user_ID; get_currentuserinfo(); if ($user_ID !== 1) { // change 1 to the id number that gets the updates add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); }
Code language: PHP (php)

Published by Dragos Micu

WooCommerce

Leave a Reply

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

dang ky 88vn bi quyet chinh phuc tai xiu hitclub ca cuoc hap dan 16028 no hu xengxi dach stade brestois vs real madrid soi keo bong da 03h00 30 01 2025 diem tua san nha ban ca than tai 8888 18786 no hu than tai tft thanbai88 tai xiu 57825 sam loc sanh rong da ga tren mang ruby win guide to online poker ban ca j88 kham pha sanh game so 1dang ky nohu bai poker an tiengame bai rikvip awin awin68 tang thuong trai nghiem 78k cho thanh vien moi dang ky fb88 co may xeng jackpot tang tien khong boss79 slot 96385 mo thay nguoi chet danh con gigame bai vin88 top 5 app ca cuoc uy tin co ty le tra thuong cao ngat nguong 15837 ca cuoc bong ro luck8 giai ma giac mo thay nui lua