Automate WordPress Database Upgrade

I’ve set up auto-updates on my WordPresses by adding

/* Updates */
define('WP_AUTO_UPDATE_CORE', true);

in the wp-config.php file.

Once WordPress releases a new version, when I try to reach the wp-admin, I get this screen screen
that complains me about a db upgrade required. After hitting the button, the db is upgraded and I get this screen screen
and all restart to work.

How can I remove and automate this annoying request from WordPress?
Is there some code to put in the wp-config.php file?
A standard user of my WordPresses is scared by seeing these screens.
As I done with Major Releases, can I automate this db upgrade?

1
1

So are you going to automate your backup as well to be triggered before the DB upgrade starts?

While the question has merit especially in a multisite context (in which the scenario is a little different) I am not sure that it is smart thing to do. That message could have said “this is your last chance to perform a backup of the DB, click the button only after you have done it”.

While it has been a long time since wordpress had a major risky DB change, this may happen again. Are you sure that you want your site to fail without you immediately knowing about that? The 30 seconds you waste every 4 moths is a small price to pay for the peace of mind, especially if those are site you are paid to maintain.

Leave a Comment