What to Do When WordPress Gets Stuck In Maintenance Mode

As I was working with WordPress today, I happened to stumble into a webmaster’s horror scenario. It all started when I noticed that some of my plugins were out of date. In an effort to correct this, I selected all outdated plugins, and then clicked the handy little “Update plugins” button. Instead of seeing the progress messages, I was greeted by this:

Internal Server Error (HTTP 500) seen within WordPress' Update Plugins page.

Uh-oh.

It was the timing of the Internal Server error that made me uneasy – did the upgrade process have time to complete? Any interruption could potentially result in database corruption, so I launched another window and tried to see if everything was working normally. Here’s what I saw:

Briefly unavailable for schedule maintenance. Check back in a minute.

Yep, definitely interrupted.

Even after a few refreshes, that message remained – which meant that WordPress switched to maintenance mode for the upgrade progress, but since it was interrupted by the crash, it never had the opportunity to disable it. In an attempt to assist, I tried to access the admin interface, only to get the same message. Seeing as I had a minor WordPress apocalypse to deal with, I wondered how I was supposed to repair it.

Solution

FTP client showing the .maintenance file in the main WordPress directory

The culprit

Thankfully, a quick web search pointed me to an article where someone encountered and resolved the same issue (emphasis added):

I noticed a strange file in the root of the site called .maintenance. The date stamp was just minutes old, so I deleted it and VOILA, the site was back to normal.

So, if you are unable to load WordPress because it’s stuck in Maintenance mode, just FTP into the root directory and delete the .maintenance file.

Good catch, John, and thanks for ending my miniature webmaster crisis.

I’m hoping that the guys at WordPress find a better way to handle cases like these, as the current approach seems somewhat dated. If they were informing administrators before every update, then there wouldn’t be problem. As it stands, victims will either have to search for a solution online, or do some investigating – both of which increase downtime. Please, WordPress… help us keep these horror scenes short.

See Also

Tutorial: Manually Take WordPress Out of Maintenance Mode