WordPress users know that the platform gets into maintenance mode each time an update is applied. It’s business as usual as visitors to your website will see a pop-up saying that work on the site is underway. Then disaster strikes. The update is complete, but you still see WordPress stuck in maintenance mode. Don’t panic; this happens. Here’s how you can get out of this dilemma.
Why WordPress Gets Stuck in Maintenance Mode
The world’s most popular CMS features a built-in maintenance mode. WordPress activates it every time you update your software, plugins, and themes. The platform creates a file called .maintenance in a root folder to trigger it into maintenance mode.
This is the same root folder that holds the following files:
wp-admin folder
wp-config.php
This file then activates the said pop-up window. Once the update is done, WordPress deletes this file. The pop-up disappears, and the site works as it usually does.
However, like every CMS, you can expect a little snag here and there with WordPress. It gets stuck in maintenance mode, which can be harrowing, especially for first-time WordPress users. Here are a few of the potential causes of this:
Accidental closure of the browser tab while the automatic update is ongoing
Automatically updating numerous plugins and themes
A glitch that happens because of a compatibility issue
How to Fix WordPress Stuck in Maintenance Mode
There are several ways to pull WordPress out of the maintenance mode. The most basic would be to simply delete the .maintenance file. After a successful update, WordPress automatically deletes this file. Nevertheless, things can sometimes go wrong.
Here are a few situations and what you should do to fix this:
Check the root folder
If you still see the .maintenance file in the root folder, remove it. You can do this by using an FTP client app such as WinSCP or FileZilla.
Download your chosen FTP client app or use the file manager given by your hosting provider (e.g., cPanel File Manager)
Connect to the FTP server and find the WordPress root folder. This is usually the public_html folder that contains all the subfolders related to your site. The root folder is where you’ll find the wp_admin folder
Search for the .maintenance and delete it using the FTP client app
Clear the browser cache and reboot your website
If you want to use the hosting site’s file manager, here’s what you should do:
Go to the hosting site’s control panel
Click on the File Manager option
Search for the .maintenance file and delete it
Alternatively, you can use an SSH connection to get you out of the maintenance mode:
Type in rm .maintenance to remove the .maintenance file
The file should be deleted, and your website will be unlocked
If the theme or plugin did not update properly
If a theme or plugin did not update correctly, it might result in your WordPress site getting stuck in maintenance mode. This is what you should do:
Connect to your FTP server and look for the root folder
Navigate to the wp-content folder and find the sub-folder containing the plugins sub-folder
Rename this folder to plugins-old
Refresh the website and check whether this solved the issue
Repeat the steps for the themes sub-folder
If the themes and plugins are faulty
When you find out that the culprits are faulty themes and plugins, here’s what you should do:
Connect to the FTP server
Rename each sub-folder back to “plugins” and “themes” to revert the previous changes you made
Go to the WordPress admin page
Find Appearance
Select Plugins or Themes depending on which is faulty
For Themes
If the theme is what causes the problem, do this:
Deactivate your current theme
Choose a different theme
The site will look chaotic, don’t panic; this means it’s working
Reactivate your old theme or reinstall its latest version
For Plugins
Activate the plugins one by one
Refresh the page to identify the plugin causing the problem
Delete the erroneous plugin
Reinstall it to see if the problem is fixed
If you still see WordPress stuck in maintenance mode, contact the developer of the theme or plugin. In the meantime, you have to stop using that plugin or find a substitute theme. Keep in mind that themes and plugins are updated regularly, so consider this when uploading them.
How to Avoid WordPress from Getting Stuck in Maintenance Mode
To reduce the chances of this happening again, take note of the following:
Plugin/Themes Compatibility
Before downloading or updating themes and plugins, make sure they’re compatible with the WordPress version you’re using. To check the compatibility of a theme or plugin, go to your WordPress dashboard.
Update Plugin/Themes One at a time
Updating the themes or plugins when updates become available is highly recommended. Do this instead of updating multiple plugins at once. This will prevent the problem from recurring as you can quickly identify which plugin causes the issue.
Additional Tips
After updating each of the plugins you use, make sure to test your website. This will ensure that the plugin is compatible and will not cause WordPress to get stuck in maintenance mode.
Another good tip is to stage your site and test the updates before using them on your live site. It would help if you always did regular updates to safeguard your website’s stability and functionality. Also, don’t forget to create backups that you can return to if, in the rare case that you aren’t able to fix the issue.
Conclusion
Getting WordPress to work smoothly and uninterrupted after an update is what every website owner should aim for. It’s a part of keeping your site in optimum working conditions. However, complications happen, and they are inevitable. Follow the steps listed above to get you out of the rut and lessen the chances of it repeating.