Remove Site Health Warning When You Don't Want WP To Auto Update

I don’t want WP Core to auto update. I’m old school and believe backups should be done before any update is applied. It is work, and often the risk is low to allow auto-updates - but there is still a risk and I’ve run into issues over the years with auto-updates. Even WP says you should always make a backup before any update.

But when you block auto-updates, you get a Site Health warning which annoys me. Here’s how you can turn that off and get a Green “Good” Site Health Status:

Add this snippet to the functions.php file:


/** Let's get rid of the annoying Site Health warning about no auto-updates. We don't want autoupdates because we want to do backups before updates! 
 */
 
 add_filter('site_status_tests', function (array $test_type) {
    
    unset($test_type['async']['background_updates']); // remove warning about Automatic background updates
    
    return $test_type;
}, 10, 1);

It annoys me to see that my Site Health is NOT good, simply because I want to backup before updates are done, or if a client logs in and sees Site Health is rated as not good and then asks questions about this.

1 Like

I’ve disabled these auto-updates with the following code, but I do allow minor (mostly security) updates:

/** Disable the possibility to enable automatic updates for WP core (WP 5.6) */
add_filter( 'allow_major_auto_core_updates', '__return_false' );

This doesn’t cause a Site Health issue on my sites.

More of these snippets I use, can be found on GitHub - JosKlever/JKWS-Maintenance-Helper: A must-use plugin I use on all sites, to change some settings, like disabling auto updates.

1 Like

Thanks, @josklever - I know some people allow security updates, but with some of my clients, I am nervous about letting that happen automatically - I want to personally confirm a backup before being applied. I can recall a security update of WP Core some years ago that screwed things up in other ways.

I personally am just very nervous about making any kind of updates without fully backing up first. It is not even just with WordPress - I used to do a lot of Linux server management and there were times (not frequently mind you - but always at the ‘this is not the best time for this…’) of seeing updates inadvertently screwing something else up.

But for others, perhaps this is not a big concern so your method is fine for them.

I can always do a rollback of WordPress Core if it would really be an issue. No backup needed for that. I never use full restores of backups to fix things. But that’s a bit off-topic here.

I was just wondering if your way to disable the core auto updates completely would cause the site health notification and my way doesn’t. So at least thanks for the snippet to solve it in case the auto updates are completely blocked. :blush:

1 Like

I use:

define( 'WP_AUTO_UPDATE_CORE', false );

in wp-config.php

That will give a Site Health Critical warning which the above snippet means WP ignores it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.