Is your site stuck in WordPress maintenance mode after an update?
Have you seen your WordPress site get stuck like this before?
The first time I saw this it scared the crap out of me because it wouldn’t go away and I couldn’t get to the WordPress admin. As far as I could tell, my site was down and there was nothing in WordPress I could do to fix it. Next, of course, I searched online and learned what to do about it. If you have encountered this, that may be how you ended up here. If so, welcome.
When you update WordPress or a WordPress plugin on your site, your site briefly enters “Maintenance Mode” so your users don’t see your site in an incomplete state during the update. Unfortunately, if an update fails or there is an error, WordPress may fail to exit maintenance mode and then the maintenance message gets stuck. This can happen even when the update completes successfully.
What happened under the hood?
To enter maintenance mode, WordPress creates a file named “.maintenance” in the root of your WordPress install. This file is created when the update starts and if all goes well, WordPress later deletes this file to take you out of Maintenance mode.
It is when WordPress doesn’t remove this file, even if your site is ok, that your site stays in Maintenance mode and no one can access it.
How to remove the Maintenance file
You will need either FTP or shell access to your site to remove the maintenance file. If you use FTP to upload new content to your site, login via FTP, navigate to the root of your WordPress install and look for the file called “.maintenance” and delete that file. If you have shell access, login, again find and delete the “.maintenance” file.
Once the file is deleted you will immediately be able to login to WordPress admin and your users will see your site rather than the maintenance message.
It is possible that there was an underlying problem that caused the maintenance file to be left behind during your update. Hopefully you made a backup of your stie before you started the updates and you can go back to the older version and carefully try the updates again.
While I don’t have a solution to never getting stuck in Maintenance mode, there are some things you can do to make site maintenance more smooth and less painful. Having a good automated backup solution for your site and always making a backup before you do maintenance is important. I’ve written another article about how to setup a good backup system for your site that you can read *here*.
If you are updating WordPress itself, make sure that all of your plugins show that they have been tested on your new WordPress version. If they have not, disable the plugins that have not yet been tested, update WordPress, and then one by one, re-enable each of those plugins. Look through your site after each plugin activation to make sure it is still working properly.