The more WordPress plugis you you, the more annoying notifications you’ll get. Therefore, in this video I am going to show you two easy methods how to hide WordPress admin notiofications.
Video: How to Hide WordPress Admin Notifications?
How to Hide WordPress Admin Notifications?
Add this snippet insideo your child theem’s functions.php file or better yet, use Code Snippets plugin for it.
// Hide WordPress Admin Notifications programmatically
function pr_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', 'pr_disable_admin_notices' );