How to disable Admin Notices in WordPress – WP Beginner

Spread The Love

When you work in the WordPress Admin Area, you’ll encounter Admin Notices. In this post, we’ll be discussing how to disable admin notices WordPress admin area.

 Plugins Reviews disable admin notices wordpress Image

Disable Admin Notices WordPress:

Just Put this Simple Code in :

Appearance >> Editor >> functions.php file:

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' );

If this Post helps you, dont forget to share it 🙂 You can also join my Newsletter for instant updates.

  • 5
    Shares

Leave a Comment

Your email address will not be published. Required fields are marked *