DEV Community

Cover image for Hiding the WordPress core update notice takes two hooks, not one (and why the badge survives)
Lucas Fenwick
Lucas Fenwick

Posted on

Hiding the WordPress core update notice takes two hooks, not one (and why the badge survives)

Every admin on a WordPress site behind the current release sees the same box above every screen: "WordPress 6.5.3 is available! Please update now." The Updates menu item carries a red count badge next to it, and on a typical production site the plugin and theme update notices stack directly underneath.

Most guides give you one line for this and stop:

add_action('admin_init', function () {
    remove_action('admin_notices', 'update_nag', 3);
    remove_action('network_admin_notices', 'update_nag', 3);
});
Enter fullscreen mode Exit fullscreen mode

update_nag() is what prints the core banner, hooked to admin_notices at priority 3, so unhooking it removes the banner. Load the dashboard and the banner is gone. The red badge is still there.

That's because the badge doesn't come from the notice at all. It's built from wp_get_update_data(), which counts pending core, plugin, theme, and translation updates and feeds both the admin menu bubble and the toolbar item. So you need a second hook:

add_filter('wp_get_update_data', function ($data) {
    $data['counts'] = [
        'plugins' => 0, 'themes' => 0, 'wordpress' => 0, 'translations' => 0, 'total' => 0,
    ];
    $data['title'] = '';
    return $data;
});
Enter fullscreen mode Exit fullscreen mode

Now the banner and the badge are both gone, and you still have the plugin update notice and the theme update notice printing on their own hooks, each with its own removal. By the time you've covered all four you have a file, and the file has to travel to every site you build. Miss one hook on one site and the client's dashboard looks half-cleaned.

I tested the settings-panel version with WP Adminify Pro instead. 20-second demo below.

What the update notices actually cost on a client site:

  • A red badge and up to three warning boxes on every admin screen, for every admin
  • The notice is aimed at whoever does the updates, which on agency builds is not the person reading it
  • Clients either learn to ignore red warnings, or they run a core update on production unsupervised
  • Nobody can dismiss it, so it never clears until someone updates

What changed after enabling Hide Admin Notices in Adminify Pro:

  • One toggle under Productivity covers core, plugin, and theme update notices at once
  • The Updates count badge clears with them, no separate filter
  • The same module handles the rest of the notice pile-up, so the dashboard opens to the Adminify panel rather than a stack of banners
  • Survives WordPress updates, no snippet to carry between sites

The caveat I won't skip: hiding the notice does not update WordPress. Your version is unchanged and any security release you're behind on is still unapplied. This is right when the update has an owner and a schedule: you, your agency, a managed host, an automation with rollback. It's wrong on a site nobody maintains, where the banner is the only signal anyone will ever get. Decide who owns updates first. Then hide the notice.

Short demo

Step-by-step doc: https://wpadminify.com/docs/adminify/productivity/hide-admin-notices

How do you handle update notices on sites you maintain for other people, unhook update_nag, hide them via a plugin, or leave them visible on purpose?

Top comments (0)