How to Fix WordPress Stuck in Maintenance Mode

How to Fix WordPress Stuck in Maintenance Mode. Is your WordPress site stuck in maintenance mode? Well, it happens-don’t worry. Every CMS has it’s down moments  and this is one unique to WordPress. In this article, we’ll show you 4 methods how to manually pull WordPress out of maintenance mode in the event that your site gets stuck in that mode. We’ll cover the following table of contents:

Table of Contents

Way back in the day Microsoft Office 95 came on roughly fourteen 3.5-inch floppy disks. Installation was always a long experience. Sometimes you’d hear the computer working or you’d hear the floppy drive doing its odd little shuffle, but the progress bar wouldn’t move. Kind soul that you are, you decide to give your computer the time and space it needs to sort things out. But when you return an hour later, the progress bar still hasn’t budged. Feelings of medieval rage start to surge.

Today things are a little better – computers are faster and, thankfully, floppy disks are only available on eBay and in long forgotten drawers. But installations and, in this case, updates, can still hang for no apparent reason at all. In this post, I’ll show you how to fix WordPress stuck in maintenance mode and how to prevent it from happening ever again on your live site.

Troubleshooting WordPress stuck in maintenance mode

It’s tempting to reach for that big red quick fix button to get your site back on track. But deactivating plugins or changing your theme, as discussed below, might not always be a good idea. In rare cases WordPress plugins can lose their settings and theme changes can sometimes break a site’s design, even when the original theme is reactivated afterwards.

And there’s always the possibility that a stubborn maintenance mode is symptomatic of a bigger problem.

Here are a few steps you can follow to find out why your site is stuck in maintenance mode.

Check the log files

The first port of call should be your site’s log files. Specifically, the error log. It is a record of all errors and warnings on your website and could help identify the resource (theme or plugin) causing the maintenance mode hiccup.

Here’s an example of errors in a local test site’s error log:

					[Wed Jun 01 17:32:45.171071 2022] [php7:error] [pid 1238] [client] PHP Parse error: syntax error, unexpected 'R_PATH' (T_STRING) in /var/ww
w/test/wp-content/plugins/elementor/elementor.php on line 54
[Wed Jun 01 17:32:45.425780 2022] [php7:error] [pid 1239] [client] PHP Parse error: syntax error, unexpected 'R_PATH' (T_STRING) in /var/ww
w/test/wp-content/plugins/elementor/elementor.php on line 54, referer: http://test.local/

(Note: This error was created on purpose by editing one of Elementor’s core files, and only serves as an example of an error log entry identifying an errant plugin. Before creating the error I made a backup of the core file. Said file has now been restored. Elementor pulled through and is doing fine.)

WordPress Hosting Setup

The location of your logs depends on your hosting setup.

  • If you’re running an Ubuntu VPS with Apache 2, look at your site’s virtual host file for the location and name of the error log.
  • The virtual host file is usually located in:  /etc/apache2/sites-available/
  • If you’re running cPanel, you’ll likely find the logs for your site under ‘Metrics’.
  • If you can’t find the logs, contact hosting support.

Test your server’s connection speed

Personal experience suggests that the ‘shared’ in shared hosting could be at the root of most maintenance mode problems. When you’re on shared hosting there’s only so much processing power, memory and bandwidth to go around. High traffic sites on the server tend to consume most of the resources, causing connection problems for smaller sites running update routines.

Even if you’re not on shared hosting, testing your connection speed from various locations could help determine whether it’s time to upgrade your hosting account.

  • dotcom-tools (no affiliation) has options for both web server and website speed tests.

Call support

The system administrators who support and maintain your hosting company’s web servers are among the unsung heroes of the internet industry. They tend to be extremely knowledgeable and skilled.

If you have no developer or system administration skills, log a call and ask for their assistance to diagnose the cause of your maintenance mode dilemma. These individuals have access to logs and tools you don’t, and getting their input can go a long way to maintaining the overall health of your site.

Four ways to fix WordPress stuck in maintenance mode yourself

During maintenance WordPress displays a notice informing site visitors that the resources they’re looking for are briefly unavailable:

“Briefly unavailable for scheduled maintenance. Check back in a minute.”

In theory, this notice should only be displayed from a few seconds to a few minutes at most, depending on the number of themes and plugins being updated.

When those minutes reach into the teens, chances are that something’s wrong and action is needed. Follow the steps below to restore your WordPress site back to operational status.

IMPORTANT: Create a backup of your entire site before proceeding.

Method 1: Remove the .maintenance file

Whenever WordPress enters maintenance mode, a file is created in your site’s root directory – the place on your web server where you’ll find wp-config.php. This file is called .maintenance.

On Linux servers, the dot ‘.’ preceding the file name means that it is a hidden file. As such, if you don’t see it initially, you’ll have to toggle the Show hidden files and folders option (or its equivalent) in the FTP app or file manager you’re using.

When the update procedure runs its course without any problems, WordPress automatically deletes the .maintenance file. But sometimes, even when the update process completed without a hitch, the file remains.

Rename or delete the .maintenance file to restore your WordPress site to its usual operational status.

Method 2: Rename your plugin directory

But what if there isn’t a .maintenance file, or what if your WordPress site is still stuck in maintenance mode once the file has been deleted?

More often than not plugins are the likely cause of your WordPress installation stuck in maintenance mode. Compatibility issues and bad code lead the charge of reasons this might occur.

In this case, simply renaming your site’s plugin directory may do the trick and help confirm that there’s a troublesome plugin lurking about.

But which one?

After you’ve renamed the plugins directory to, say, plugins_OLD, create a new plugins directory in wp-content.

Copy the index.php and hello.php files from plugins_OLD to plugins. Then, move the first plugin from plugins_OLD over to plugins.

Update the plugin if necessary, and check your site for normal operation. If all’s well, repeat the process for all other plugins until you’re able to identify the errant plugin.

There is a shorter, more elegant way to identify plugins responsible for getting your site stuck in maintenance mode. See Check the log files in Troubleshooting WordPress stuck in maintenance mode.

Method 3: Activate a different theme

“Always keep a basic theme installed” can make for an interesting bumper sticker and is also good practice. Themes, like plugins, can contain bad code, or fail to update correctly from the source.

When there is no .maintenance file and all your plugins have updated successfully, activating the basic theme should be your next step. I always keep one of the WordPress default twenty-something themes in stock. It’s a theme made by the people who brought you WordPress, so, in theory, it should always be compatible with the CMS itself.

Your site won’t display the same using a different theme, but all we’re aiming for now is getting the site out of maintenance mode. If this does the trick, your theme is the culprit.

Method 4: Modify wp-activate.php

Use a file manager, FTP app, or SSH to navigate to your site’s root directory – the same place you looked for the .maintenance file, and where wp-config.php is located.

Open wp-activate.php and look for the following line of code:

					define( 'WP_INSTALLING', true );

WP_INSTALLING is a WordPress constant that defines whether WordPress is in installation mode. By default, it is set to ‘true’.

Change true to false:

					define( 'WP_INSTALLING', false );

Save and close the file.

How to update WordPress safely

Organizations with complex websites directly integrated into other systems know the risk and cost of potential downtime. As such, most run not only one version of their website, but at the very least two – a production site which is publicly visible on the internet, and a staging site which is only accessible by select internal staff.

The purpose of a staging site is to test the effect of any potential changes before those changes are applied to the production site. For this reason, the production and staging sites are near identical before any changes are made.

See where I’m going with this?

Managed WordPress hosting packages typically include a one-click staging feature, which makes it easy to create a staging copy of your production site. Testing updates on your staging site can dramatically reduce the risk of downtime on your production site.

Staging site

If you have managed WordPress hosting that includes staging functionality, here’s how to go about testing updates on your staging site:

  1. Always create a complete backup of your live site before creating the staging site. This ensures that you always have a copy of the plugins and files that work.
  2. Copy your production site to the staging site. Save for URL and any live data, the two sites should be identical before you start.
  3. WordPress makes it easy to one click update all your plugins. But to save time – in the event of an errant plugin – update each plugin individually and test site functionality after each update. This strategy also makes it easier to identify problem plugins.
  4. Repeat the process above for your theme updates. 
  5. Replace any problem plugins or themes with those from your initial backup, and continue the process.
  6. When you’re done, create another backup of your production site to capture any data changes that might have occurred during the staging update.
  7. Update the themes and plugins on your production site, except those that caused problems during the staging update.

While the process above might seem tedious at first, keep in mind that it can reduce the potential for downtime, data loss, and, if you generate an income through your site, loss of revenue down the line. No more stubborn WordPress maintenance mode. Fewer worry wrinkles.

I hope your knowledge has become richer with the tutorial How to Fix WordPress Stuck in Maintenance Mode. Let’s summarize.

How to Fix WordPress Stuck in Maintenance Mode Conclusion

We come to the end of this guide on how to fix WordPress site stuck in maintenance mode.  It is vital to always take a backup of your site and use staging whenever possible. This helps with WordPress maintenance mode issues and a whole range of possible problems. Performing an updates in WordPress is of paramount importance if you wish to keep it secure for the core, themes, and plugins. Why don’t you take a look at WordPress security plugins also.

Avatar for Leo De Jager
Leo De Jager

I'm a freelance writer in the tech industry. When I'm not writing about hosting-related topics, I spend my time doing calisthenics or in the ocean doing my level best to stand on a surfboard.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x