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 *

juego adventures beyond wonderland betrivers casino wv resena casino 888 ruleta gratis mx superplay nuevo bono slots mobil bahis casino resena panama roobet el balance del segundo trimestre del juego online 2023 en espana gala casino resena xtreme win casino resena casino club resena blackjack online con crupier casinos en rio cuarto cordoba jackie jackpot casino resena honey money casino resena novibet casino resena just for the win 21 blackjack descargar juegos para pc casino reglas de la ruleta space invaders getta gaming fruits and juice lights camera bingo casino ie resena juego mysterious cripto casino con 100 giros gratis betvictor casino th resena bitcoin cash video casino resena copenhagen casino bono sin depsito 50 giros gratis 2025