How to get rid of WordPress admin notifications?

Royal96

Power Member
Joined
Mar 16, 2019
Messages
683
Reaction score
376
I've tried code and plugins, but there are always a few notifications slipping through.

Do you know how to disable/hide all of them, preferably with PHP?

This code snippet removed almost every notification, but not entirely:

add_action('admin_head', 'bc_disable_notice'); function bc_disable_notice() { ?> <style> .notice { display: none;} </style> <?php }
 
Tried this one https://betterstudio.com/blog/remove-wordpress-admin-notice/
inside function.php
Code:
add_action('admin_enqueue_scripts', 'ds_admin_theme_style');
add_action('login_enqueue_scripts', 'ds_admin_theme_style');
function ds_admin_theme_style() {
    if (!current_user_can( 'manage_options' )) {
        echo '<style>.update-nag, .updated, .error, .is-dismissible { display: none; }</style>';
    }
}
 
Back
Top