How to hide WordPress updates admin messages in the dashboard

How to hide WordPress updates admin messages in the dashboard

It is very important to keep WordPress up to date because of security threats and other backend functionalities, especially nowadays due to its popularity. Some cases we made lots of customisations on core WordPress files, they might not want this message to display, because it will overwrite all the files and client site will lose all the changes. Below you can find a code snippet to hide dashboard admin notices you just need to add it into the function.php file or you can create a WordPress plugin with the code below.

/**
 *
 * Hide WordPress nags
 */
if ( ! function_exists( 'ns_wp_hide_nag' ) ) {
function ns_wp_hide_nag() {
 remove_action( 'admin_notices', 'update_nag', 3 );
}
}
add_action('admin_menu','ns_wp_hide_nag');
}

ABOUT AUTHOR

Nuno

I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.

  • LET'S TALK!

    Fill in the form below to make an enquiry or find my contact details on my contact page.