# Hide Admin Notices From Non-Administrators

> Removes plugin and theme notices, update nags and promotions from the admin for everyone who is not an administrator.

- Type: PHP
- Runs: Admin only
- Category: [Disable Features](https://wpide.com/library/category/disable-features/)
- Tags: disable, notices, client
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/hide-admin-notices-non-admins/

## Code

```php
add_action( 'in_admin_header', function () {
    if ( current_user_can( 'manage_options' ) ) {
        return;
    }

    remove_all_actions( 'admin_notices' );
    remove_all_actions( 'all_admin_notices' );
}, 999 );
```

## Notes

Messages like "Post updated" are not admin notices and keep showing.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Admin Notices From Non-Administrators" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
