[WordPress] How to hide notices in the admin panel

kagero

New member
Sep 18, 2019
27
8
3
Most notices after installing a plugin can be closed, but some reappear after every page refresh. Many are premium plugins that request you to enter a valid key.

There's a plugin to hide every notice, but some are actually useful, such as one-time onboarding messages.

The solution is simple: install this free plugin, aptly called Disable admin notices individually.

The rest is self-explanatory; good luck!
 

e1ude

New member
Jan 30, 2020
17
24
3
That plugin looks great. I think I came across it a while back, but was already removing them myself. I'll give it a try to see if it removes everything I need.

For anyone that wants to do things manually, here's some sample code for your child theme's functions.php

The text to search for and the CSS selectors would need to be customized per notice.

And sometimes you do get a flash of the content with this method since they are being hidden by the browser.

PHP:
// Remove Plugin List Nag


function my_custom_styles() {
    echo '<style>
   td.plugin-update { display: none; }
   .yoast-notice-error { display: none; }
   .update-nag { display: none; }
   .toolset-notice { display: none; }
  </style>';
}

add_action( 'admin_head', 'my_custom_styles' );

// Remove Other Plugin Nags
add_action ('admin_footer', 'my_custom_scripts');

function my_custom_scripts() {
    $script= '<script>
    jQuery( "p:contains(\'license key\')" ).parent().hide();
    jQuery( "p:contains(\'Connect your store\')" ).parent().hide();
    jQuery( "p:contains(\'updates and support\')" ).parent().hide();
    jQuery( "p:contains(\'activate your license\')" ).parent().hide();
    jQuery( "p:contains(\'update your license\')" ).parent().hide();
    jQuery( "h2:contains(\'Register for News\')" ).parent().parent().hide();
    </script>';
    echo $script;
}
 

ckeeper

Well-known member
Nov 8, 2019
623
376
63
Add the following into your functions.php for active theme.
PHP:
add_action('admin_head', 'bc_disable_notice'); function bc_disable_notice() { ?> <style> .notice { display: none;} </style> <?php }
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu