How to disable All Admin Notices in WordPress using Code

Young smiling expressive caucasian woman shout in megaphone against blue background

How to disable All Admin Notices in WordPress using Code

Are you sick of countless bothersome “notices” in your WordPress install. Well never fear, the code below is easy to add and will 100% remove all notices.

How to disable All Admin Notices in WordPress

Find your functions.php file and paste the following code into it, then save.

function nf_disable_admin_notices() {
global $wp_filter;
if ( is_user_admin() ) {
if ( isset( $wp_filter['user_admin_notices'] ) ) {
unset( $wp_filter['user_admin_notices'] );
}
} elseif ( isset( $wp_filter['admin_notices'] ) ) {
unset( $wp_filter['admin_notices'] );
}
if ( isset( $wp_filter['all_admin_notices'] ) ) {
unset( $wp_filter['all_admin_notices'] );
}
}
add_action( 'admin_print_scripts', 'nf_disable_admin_notices' );