Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hides All Notices in WordPress Admin Pages from all users except admins
You may use current_user_can('administrator') instead of is_super_admin() for not MU sites
DO NOT use is_admin() since it doesn't check users role nor capability
Be aware this hides also notifications thant a content (page/post/...) was saved
function remove_admin_notices() {
remove_all_actions( 'admin_notices' );
echo "<style>.wp-admin .notice {display:none !important;}</style>";
add_action( 'admin_head', 'remove_admin_notices' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.