When you update your plugins and themes and install new themes and plugins then, your WordPress website enters maintenance mode. This protects you and your visitors from not seeing a broken website or harming the website in any way. but sometimes, your WordPress website can get stuck in maintenance mode.
When your WordPress website gets stuck in maintenance mode, the most straightforward way of fixing this is to sign in on your web server via an FTP client or the file manager provided by your host. And then delete the file with the name .maintenance.
If you want a more detailed answer with images, I’ll dive into this in the next section. I will also give you some tips on how to avoid getting stuck in maintenance mode again. Let’s get into it.
How To Fix WordPress Stuck In Maintenance Mode
The main reason why your WordPress website gets stuck in maintenance mode is if a plugin update fails. There are multiple reasons why. Maybe you clicked away from the page before it was done updating, or there was an error in the new update that made it get stuck.
Luckily there are 3 solutions to this either we can use FileZilla or a File Manager provided by your host. As a third and last option, we can update the wp-activate.php file to stop the maintenance mode.
1. Get out of Maintenance mode in WordPress using FileZilla
If you’re already familiar with using FileZilla with your WordPress website, this is the most straightforward solution.
When you have connected to your server through an FTP or SFTP connection, you need to find the root of your WordPress installation, and here, you will see a file name .maintenance.
All you have to do is right-click and delete this file. You’ll now be able to enter your website, refresh the page and see it’s all back to normal.
If you can’t see the file, there are 2 reasons for this. Either your server is not showing hidden files, or you must jump to method 3.
Before you try method 3, then try to click on the server in the FileZilla menu and press “Force showing hidden files”. If the .maintenance file is showing now, simply right-click and delete the file. If it’s still not showing, then you need method 3.
2. Get out of Maintenance mode in WordPress using a File Manager
Now if you’re not familiar with FileZilla and you want to use the file manager provided by your host, you can easily do this as well.
Sign in via your hosting and open the file manager. Find the root of your WordPress website. Once you’ve found it, you should see a file named: .maintenance file. Right-click on this file and press delete the file.
Just like with FileZilla, you can experience you just can’t see the file, which might be because your file manager is not showing hidden files. Luckily there is a solution for this as well.
Click on settings often in the top right corner, and here you will get a popup where you can checkmark Show Hidden files (dotlottie). Press save and then see if the .maintenance file is now showing.
3. How To Fix Maintenance Mode Without a Maintenance File
Now you may sign in on your web server, and you simply can’t see any .maintenance file, or you have deleted the .maintenance file, but your WordPress website is still in maintenance mode. Don’t worry; there is a solution for this as well.
Via FileZilla or your file manager, access your server and navigate to the root folder of your WordPress website. Edit the file with the name wp-activate.php in any text editor you might have installed.
If you’re not familiar with PHP coding, don’t worry about all the words and characters, all you need to look for is where in the file it says:
define ('WP_INSTALLING', true);
You can often find it at the top of the file on line 9. All you have to do is change the word true to false. So it now looks like the following:
define ('WP_INSTALLING', false);
After this, save your changes by pressing CMD + S or CTRL + S. Then make sure the file is uploaded to your server by checking FileZilla or your File Manager.
After this is done, open up your website, refresh the page, and your WordPress website should return to normal.
Why WordPress Enters Maintenance Mode
The maintenance mode is no error page. It’s to protect and tell you and your visitors that a process is happening on your WordPress website. The most common reasons are you’re installing/updating a plugin or a theme.
When you update a plugin, WordPress shows you a page where it tells you it’s entering maintenance mode and when it’s leaving maintenance mode.
It’s a vulnerable process where your website is downloading some files which integrate into your WordPress installation. To avoid any disturbances in this process, your WordPress website enters maintenance mode.
As soon as your process is done, whether it’s updating or installing a plugin or theme, then the maintenance screen will disappear, and your website will be back to normal.
However, once in a while, it gets stuck for numerous reasons, and that’s when you need to delete the .maintenance file to get your WordPress website back to normal.
How To Prevent Being Stuck In WordPress Maintenance Mode Again
There are some minor changes you can make to avoid getting stuck in maintenance mode again with your WordPress website.
These steps are not crucial, but they do minimise the risk of ending up getting stuck in maintenance mode once again.
Ensure Managed WordPress Hosting
A reason why your WordPress website can get stuck in maintenance mode is that your server is simply too slow. When your WordPress website updates plugins and themes, it goes through a process where it first downloads the new version and then installs it.
If your server is slow, this is a longer process, and if it takes longer than 30 seconds, you’ll often see your server simply timeout and then your WordPress website gets stuck in maintenance mode.
Therefore, I always recommend signing up for managed WordPress hosting or hosting, which has some experts within WordPress.
With managed WordPress hosting, you get servers customised to be as optimised as possible for WordPress websites.
Always check compatibility with your current version of WordPress
I’ve written an article with 3 essential factors when you install a new plugin.
To sum up, then it’s essential you check the metadata on the plugin. Whether it’s tested up to your current WordPress version. Is it updated within the last few months, and how are the plugin reviews?
If the plugin has terrible reviews, it’s most likely because it doesn’t work or it makes people’s WordPress websites crash, so do yourself that favour and double-check this before you install and update plugins and themes.
Why does my WordPress site keep going into maintenance mode?
This is often in the process of installing a plugin or a theme or updating a plugin or a theme. If you have a slow server, it’s because your server is timing out.
If you’re trying to install a plugin which isn’t compatible with your current version of WordPress, this would also be a reason.
How do I turn off maintenance mode?
If it’s WordPress built-in maintenance mode, you turn it off by simply signing in on your server via FileZilla and deleting the file named .maintenance.
If it’s a plugin which shows the maintenance mode, then you have to sign into your WordPress admin area and deactivate the option or the entire plugin to be sure.