Removing the Jetpack nag notice in Wordpress

Note: This was written for WordPress version 5.8.1 and Woocommerce version 5.6.0

The lastest versions of Woocommerce comes with a nag notice on the admin dashboard, to install Jetpack:

This notice is non-dismissable and gets really annoying after a while. Who needs the visual clutter?

Digging into the woocommerce files shows that the responsible function is called “show_nux_banner” in wp-content/woocommerce-services/classes/class-wc-connect-nux.php, line 615.

Annoyingly, there’s no filter or action to negate the calls to this function (that I’ve been able to find at least), so the easiest way to remove it is to simply hide it with some custom css.

Create a new css file in your theme or plugin called remove-dashboard-nags.css, and add the following:

.notice.wcs-nux__notice
{
    display:none !important;
}

Then add the following snippet to your functions.php (if you’re building a theme):

 // Removing Jetpack upsells
function remove_jetpack_dashboard_nags()
{
    wp_register_style('remove-jetpack-dashboard-nags', get_template_directory_uri() . 'remove-dashboard-nags.css', 10); // use plugin_url('remove-dashboard-nags.css') if you're building a plugin.
    wp_enqueue_style('remove-jetpack-dashboard-nags');
}
add_action('admin_init', 'remove_jetpack_dashboard_nags', 10);

And now the nag notice is hidden.

The CSS and JS files for the nag are still unnecessarily loaded, however. It would be nice if Woocommerce gave us a filter or action to remove them properly and avoid the extra network calls.

Recent brain activity: