Do you have many plugins installed? Do you receive way too many notifications in the WordPress Dashboard? By default, WordPress displays some notifications on the homepage of your Dashboard. These notifications can notify you to update certain plugins or activate certain plugins.
In this article, we are going to discuss how to remove WordPress admin notice with a plugin and code.
How to Disable Admin Notices in WordPress?
WordPress is a flexible CMS. You can add or remove features to it by installing or removing plugins. There are thousands upon thousands of plugins that can add different functionality to your website. The Disable Admin Notices Individually plugin can take care of annoying notices in the WordPress Dashboard.
All of us are tired of the notices displaying on the homepage of the WordPress Dashboard, with the help of this plugin, you can turn off notices forever and individually! This works for notices from plugins and WordPress itself.
This plugin adds a “Hide notification forever” underneath each notice in the Dashboard. By clicking on this link, you will never see the notification ever again. You can use this method to only disable the annoying notices that keep popping up on the homepage and let WordPress keep displaying the important notices like updates.
Besides, in the configurations, you can set the plugin to completely disable all notices site-wide. In this case, the plugin removes WordPress admin notices and keeps the important update notices.
In addition, there is a special place in the top admin bar which collects all the notices in one place. By default, this feature is disabled in WordPress. However, you can enable it through the plugin’s settings.
All you have to do is to download the plugin from the official WordPress website or directly from the WordPress Dashboard. Install, and activate it and you’re good to go!
To Disable WordPress Admin Notices:
- Login to the WordPress Dashboard
- Hover over Settings and click on Hide admin notices plugin
- In the Hide Admin Notices tab you have three options. All notices, Only selected and Don’t hide
- By selecting All notices, you have the option to enable or disable hidden notices in the admin bar.
- By selecting the Only selected you have the option to enable hidden or disable hidden notices as well as reset hidden notices for all users or the current user.
- Don’t hide turns off the plugin. So, it won’t display the “Hide Notification forever” in the WordPress Dashboard.
Besides, if you come across any problems you can submit a ticket and ask the developers to help you with it.
How to Remove WordPress Admin Notices with Code?
If you have a bit of programming knowledge and don’t want to install any extra plugins on WordPress, we recommend following this method.
Like always, we recommend getting a full backup of WordPress then follow the steps below.
Simply use this code snippet. You can add it anywhere in the functions.php file or wp-config.php file of WordPress. You can access both of them directly through the hosting panel (cPanel) or with an FTP client.
Download either of them on your computer and open it with a text editor like Notepad++ and add the following code to it:
add_action('admin_enqueue_scripts', 'ds_admin_theme_style');
add_action('login_enqueue_scripts', 'ds_admin_theme_style');
function ds_admin_theme_style() {
if (!current_user_can( 'manage_options' )) {
echo '<style>.update-nag, .updated, .error, .is-dismissible { display: none; }</style>';
}
}
This code should easily get rid of the WordPress admin notice in the Dashboard.
Conclusion
In this article, we talked about getting rid of annoying WordPress admin notices. Generally, there are two methods you can follow to get rid of the notices. You can install a plugin or use a piece of simple code to disable them forever.
If you are going to use the code, we highly recommend getting a full backup of WordPress before making any changes to the core files. In case anything goes wrong, you can always restore WordPress to the original state.