Skip to content

PHP code snippet – How to remove annoying plugin notification in wordpress?

/** This code may be used in functions.php, wp-config.php, or used to create an mu-plugin
* The purpose of the code is to remove all the anoying popups in WordPress
*/

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>';
	}
}
See also  Python code snippet - How to make a movement controler?

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.