The WordPress maintenance mode is activated when an update is applied. When visitors try to access a website that is in maintenance mode, a message will pop up to notify them that you are currently working on it. Everything seems normal until this point, but the situation gets complicated when the update process causes WordPress to get stuck in maintenance mode.
When making an update, a file called .maintenance is created in the root folder of WordPress.
This file tells WordPress to put your site into maintenance mode and it contains the information needed to display the message that will pop up for users.
When the update installation is completed, WordPress deletes the .maintenance file and the message should disappear right away.
In some situations, while updating, WordPress encounters an error that makes it get in maintenance mode. The user is left with a situation that can be really troubling if it is not rapidly solved. This matter is discussed in detail below by our wpDataTables team.
If you find yourself in this situation and you’d like to know how to fix the issue as fast as possible, then keep reading to see which solution works for you.
WordPress maintenance and updates – what you should know
Before learning how to solve the problem, it’s a good idea to learn what leads to getting your WordPress site in maintenance mode in the first place. Updates are vital for a robust WordPress site, and it’s wise not to skip any unless you have a strong reason to.
WordPress maintenance is imperative for keeping your site secure and bugless.
New threats will always be a problem, but updating your WordPress regularly keeps it as far away as possible from getting compromised.
Moreover, updates can also add new features to the original software that can be very helpful. You have every reason to opt for them, no matter what kind of website you have.
What to do when you can’t get your site out of the WordPress maintenance mode
Before jumping into details of the manual recovery options, one of the first recommendations we could give is to use a managed WordPress hosting instead of a generic VPS.
It solves a lot of standard WordPress-related problems, such as regular auto-updates and maintenance (without being stuck in this mode), daily backup and quick recovery, automated anti-DDoS and anti-malware protection, and support by WordPress experts. Kinsta is a great choice for hosting your website, thousands of websites, including large ones like TripAdvisor, Buffer, and Intuit are relying on it.
If you have your WordPress website in maintenance mode, there are a few solutions you can try.
The basic error can be fixed by deleting the .maintenance file from the root folder manually.
If the update is installed successfully, WordPress automatically deletes the file from your folder. If the updating process didn’t go well, the file will still be there. Even so, the file might have disappeared, but WordPress is still stuck in maintenance mode. We will provide solutions for both situations.
If the .maintenance file is located in the root folder
Option 1: Use FTP software
The most frequent cause of WordPress becoming stuck in maintenance mode is the .maintenance file. You will have to remove it in one way or another. The first way you can do it is by using an FTP client app. Follow these steps:
- Get an FTP client app or use the file manager that your hosting provider gave you (for instance, cPanel File Manager)
- Connect to the FTP server and navigate to the WordPress root folder. This folder is usually under the folder called public_html and it contains all the folders and subfolders that are related to your WordPress site. If you can see the wp-admin folder (but you’re not inside the wp-admin folder), you’re in the root folder of WordPress.
- Look for the .maintenance file, select it, and delete it using the FTP app
- Clear the browser’s cache and reload your website
Option 2: Use a file manager
You can use your web host’s own file manager to delete the .maintenance file. For example, Hostinger is one web host that provides a file manager that is not much different from the file managers offered by other hosting providers, and you can use other file managers in a similar way. Here’s what you should do:
- Access your hosting’s control panel
- Click on the File Manager option (They almost all have it)
- Locate the .maintenance file, select it, and delete it
Option 3: Use an SSH connection
This is the third option you can use for releasing WordPress from maintenance mode:
- Set up an SSH connection (e.g. PuTTy)
- Navigate to the WordPress root folder
- Delete the .maintenance file by typing in the following line of code:
- The file should be gone, and your website restored
If the theme or plugin did not update correctly
In some cases, the theme or a plugin that you use may cause your WordPress to get stuck in maintenance mode during updates. In order to find out if this is the issue, you need to rename the plugins and themes folders. To do that, follow these steps:
- Connect to your FTP server using an app of your choice and access the root folder
- Navigate to the wp-content folder and find the plugins subfolder
- Rename the folder to plugins-old
- Refresh the website to see if everything went back to normal
- If not, repeat the same step for the themes subfolder
Solution for faulty plugins or themes
Now you should know whether it’s a plugin or a theme problem, and you can proceed to apply this solution to fix it. Connect to the FTP server and revert the changes you made above by renaming each subfolder back to “plugins” or “themes”, respectively. Go to the WordPress Admin page and navigate to Appearance, then Plugins or Themes, depending on which is at fault.
For plugins: Activate the plugins one at a time and refresh the page after each to see which exact plugin is causing the issue. Once you’ve found out which one is responsible for your WordPress getting stuck in maintenance mode, delete the plugin. You can reinstall it later and see if the problem is fixed.
For themes: Deactivate your current theme by activating any other theme, such as the default Twenty Nineteen. This will turn your site into a possibly unsightly mess, but at least it is working for the time being. Try reactivating your theme, or reinstalling it from scratch using the latest version.
If it still doesn’t work after reinstalling, you can contact the developer of the plugin or theme and let them know about the issue. In case the problem can’t be fixed, you will have to stop using the plugin or theme. Top WordPress plugins are always updated on a regular basis, so pay attention to this detail when you choose a WordPress plugin next time.
Preventing your site from getting stuck in WordPress maintenance mode
Even though solving WordPress stuck in maintenance mode issue is not very difficult, it is a process that takes some time. This makes the experience an uncomfortable one that people would rather avoid.
You can take a series of precautions that may prevent WordPress from getting forced into maintenance mode. Apply these precautions as soon as possible and you won’t be faced with this problem as often.
Always make sure that your themes and plugins are compatible
The WordPress version you are using should be fully compatible with the plugins or themes that you are willing to download or purchase. An incompatibility problem between the two will lead to WordPress getting stuck in maintenance mode whenever you are trying to update your system.
Check the compatibility of each plugin with your current version of WordPress whenever you install a new plugin and make sure that your website respects the requirements that are mentioned for each theme and plugin that you are planning to use in the future. Paying more attention during this step will keep your website in good shape.
Don’t update all your plugins at the same time
We have some experience with WordPress plugins since we created the best WordPress table plugin out there. Over the years we’ve seen various mistakes that you could do with your plugins.
A mistake that leads to WordPress becoming stuck in maintenance mode has to do with how you update the plugins you are using. Executing more than just one update at a time (i.e. with Bulk updating) prevents you from being able to easily tell which plugin caused an error after being updated.
You should err on the side of caution instead, and update each plugin individually, testing your site after each update to ensure that the plugin is truly compatible.
Now that you have learned how to fix WordPress being stuck in maintenance mode, make sure to understand what caused the issue in the first place. Preventing it from happening again is much more important than quickly solving it.
Stage your site and test updates before making them on the live site. Update your WordPress, themes, and plugins regularly to avoid unpleasant situations from appearing later. Check your website after each of these updates to make sure that everything works as it is supposed to. Finally, always create backups so that you are able to return to a previous version of your website if the issue can’t be fixed.
If you enjoyed reading this article about the WordPress Maintenance Mode, you should read these as well:
- How to Leverage Browser Caching in WordPress? Steps to Follow
- WordPress Dashboard Login Does Not Work? Here’s What You Need to Do
- WordPress countdown timer examples to try on your website