Last active
October 24, 2025 06:58
-
-
Save audrasjb/150b140a8484311c87c28da244f389bc to your computer and use it in GitHub Desktop.
Hide admin notices in WordPress Multisite except for super-admin account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hides admin notices except for super admins of a multisite. | |
| */ | |
| function jba_hide_notices_except_for_super_admin() { | |
| if ( ! is_super_admin() ) { | |
| remove_all_actions( 'user_admin_notices' ); | |
| remove_all_actions( 'admin_notices' ); | |
| } | |
| } | |
| add_action( 'in_admin_header', 'jba_hide_notices_except_for_super_admin', 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment