How to Fix WordPress Stuck in Maintenance Mode

how to fix wordpress stuck in maintenance mode

Regardless of whether you’re a website owner or just a visitor, seeing WordPress stuck in maintenance mode is a problem. The good news is that this issue is common and is easily fixed. Let’s go over how to get WordPress out of maintenance mode, as well as how to prevent this from happening again.

Why WordPress Has a Maintenance Mode

WordPress has a maintenance mode page used for multiple reasons. This includes updates of any kind, as well as if you need to perform maintenance on your backend/frontend.

When you update your WordPress site, whether it’s the core files, themes, or plugins, WordPress activates its maintenance mode page automatically. This page lets visitors know that updates are being carried out on the website. In most cases, this maintenance screen is shown for just a few seconds. After the updates are completed, your website comes back online as usual.

However, there are instances when an update does not complete successfully, resulting in maintenance mode getting stuck. Alternatively, an update can be incomplete resulting in the same maintenance page.

This can happen due to slow server response times, low memory issues, or any kind of interruption during the update process. When this occurs, you’ll have to manually disable maintenance mode to restore your website’s functionality.

Fixing WordPress Stuck in Maintenance Mode

If you are a website visitor (you don’t own the website)

If you see the maintenance page on a website you’re trying to visit, there’s really not much you can do. The main fix you can try is to access the website using another device or browser, or clearing your browser’s cache.

Alternatively, you can try to wait a little and hope that the website owner successfully fixed the issue. If you are the website owner, keep reading to find out what you can do:

If you are the website owner

To resolve your WordPress from getting stuck in maintenance mode, you’ll need to follow these steps. Your main goal is to delete the .maintenance file which is created in the root folder of your WordPress site whenever updates are applied. That is the most common cause of this issue. To do this, you will need to connect to your web server using an FTP client, your hosting provider’s file manager, or via SSH if you have access. Let’s dive into the step-by-step process for each:

Removing the .maintenance file using FTP:

Step 1: Connect to Your Site Using FTP

wordpress remove maintenance filezilla

To access your website’s files, you will need to connect to your site using an FTP (File Transfer Protocol) client. FileZilla is a popular and reliable FTP client that you can use for this purpose. Once you install this program, enter your FTP credentials. Make sure to include your server’s IP address, username, password, and port. Then click on Quickconnect to establish a connection with your site.

Step 2: Locate and Delete the .maintenance File

Once connected to your site using FileZilla, navigate to your website’s WordPress root directory. You’ll know you’re in the right spot if you see files/folders like wp-content and wp-config.php.

Here, you should find the .maintenance file. If you don’t see it, make sure to enable the option to show hidden files in your FTP client. Once you locate the file, right-click on it and select the delete option to remove it from your site. You can skip ahead now if you deleted the file.

Removing the .maintenance file using SSH:

Step 1: Connect to Your Server Using SSH

Log into your server using the ssh command:

ssh -p 22 root@server.ip.address

Replace server.ip.address with your server’s IP address. If your server uses a non-standard SSH port, you can replace the 22 in the above command with the port number. Also, if you use a user other than root, you can replace root with the correct username. Then enter your password when prompted. You should be logged in now.

Step 2: Locate and Delete the .maintenance File

Using the cd command, navigate to your website’s root directory. The most common website root directory is /var/www/html/. To change to this folder, you can run the following command:

cd /var/www/html/

If you get an error like cd: no such file or directory, then your website’s root folder is elsewhere. You can then use the ls -la command to view the folder’s contents including all hidden files. You’ll know you’re in the right spot if you see files/folders like wp-content and wp-config.php. You can then delete the maintenance file using this command:

rm -f .maintenance

That should delete the file no problem. Once it’s deleted, you can continue to the next step.

Clear Cache and Test Your Site

After deleting the .maintenance file, you should clear the cache on your WordPress site. If you are using a caching plugin or a managed WordPress hosting service, there are usually options available to clear the cache directly from your WordPress dashboard or through your hosting provider. If you have a managed hosting provider, you can just ask them to clear any server caches for you. Clearing the cache helps ensure that your site is showing the true data from the server files after resolving the maintenance mode issue.

Finally, test your site by accessing it in your browser and force refreshing using Ctrl+Shift+R (Cmd+Shift+R on macOS). If everything is working correctly, your website should no longer display the maintenance mode screen, and you should have full access to your site’s frontend and backend.

Troubleshooting Tips if the .maintenance File is Missing

In some cases, you may not find the .maintenance file in the website root directory even after showing hidden files. If this is the situation, there are a few additional steps you can take to resolve the issue:

Renaming the Plugins Folder

One troubleshooting technique is to rename the WordPress plugins folder to temporarily deactivate all plugins. By adding an underscore before the folder name (e.g., _plugins), you can disable all plugins at once.

Renaming the Plugins folder using FTP:

Step 1: Connect to Your Site Using FTP

You can connect using FTP as explained earlier in this article.

Step 2: Locate and Rename the Plugins Folder

Once connected to your site using FileZilla, navigate to your website’s WordPress root directory. You’ll know you’re in the right spot if you see files/folders like wp-content and wp-config.php.

Here, you should find the plugins folder. Right click it and select Rename. Rename it to _plugins for example. Move onto the next step.

Renaming the Plugins folder using SSH:

Step 1: Connect to Your Site Using SSH

You can connect using SSH as explained earlier in this article.

Step 2: Locate and Rename the Plugins Folder

Using the cd command, navigate to your website’s root directory. The most common website root directory is /var/www/html/. To change to this folder, you can run the following command:

cd /var/www/html/

If you get an error like cd: no such file or directory, then your website’s root folder is elsewhere. You can then use the ls command to view the folder’s contents. You’ll know you’re in the right spot if you see files/folders like wp-content and wp-config.php.

Then enter the folder called wp-content using the cd command:

cd wp-content/

Inside of there is a folder called plugins. Rename it using the mv command:

mv plugins/ _plugins/

Try Accessing your Website

This step helps identify if any plugins are causing conflicts or preventing your site from exiting maintenance mode. If you can access your site after renaming the plugins folder, you can rename the folder back to plugins and gradually reactivate each plugin until you find the one causing the issue.

Disabling the Theme

If disabling plugins does not resolve the maintenance mode issue, you can try disabling your theme temporarily. Similar to renaming the plugins folder, you can rename the themes folder to deactivate it. By doing this, you can determine if the theme is causing the problem. If your site starts loading after disabling the theme, you may need to update or replace it with a compatible version.

Updating the wp-activate.php File

If you have tried the previous troubleshooting steps and the maintenance mode issue persists, you can try updating the wp-activate.php file. This file is located in the same directory as the .maintenance file. Open the wp-activate.php file using FileZilla or via your preferred text editor over SSH (such as nano or vim). Look for the line of code that says define('WP_INSTALLING', true) and change it to define('WP_INSTALLING', false). Save the file and upload it back to the same location on your server if needed. This modification should take your site out of maintenance mode.

Preventing WordPress from Getting Stuck in Maintenance Mode

wordpress maintenance page

While dealing with maintenance mode issues can be frustrating, there are steps you can take to prevent it from happening in the future. Here’s our advice to avoid getting stuck in maintenance mode:

1. Upgrade Your Hosting Plan

One common cause of maintenance mode problems is slow server response times or low memory issues. If you consistently encounter these issues, consider upgrading your hosting plan or switching to a managed WordPress VPS provider that offers better performance and dedicated resources.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS

2. Update Plugins and Themes One at a Time

Instead of updating all your plugins or themes simultaneously, update them one at a time. This approach allows you to identify any compatibility issues or conflicts that might pop up during the update process. By updating plugins and themes individually, you can minimize the chances of encountering maintenance mode problems without knowing what caused it.

3. Limit the Number of Plugins

Having too many plugins installed on your WordPress site can increase the risk of maintenance mode issues, as well as affect site performance. To prevent these problems, regularly review your installed plugins and remove any unnecessary ones. Stick to using only essential and reputable plugins that are actively maintained and compatible with your WordPress version.

4. Check Theme and Plugin Compatibility

Before updating your WordPress core or installing new plugins, ensure that your theme and existing plugins are compatible with the latest WordPress version. Incompatible themes or plugins can cause conflicts and trigger maintenance mode problems. Check for updates or contact the theme/plugin developers to confirm compatibility before proceeding with updates.

5. Monitor Your Website’s Performance

Regularly monitor your website’s performance using tools like Google PageSpeed Insights or GTmetrix. These tools can help you identify any performance issues that may contribute to maintenance mode problems. Optimize your site’s speed and performance by implementing caching, optimizing images, and minimizing the use of external scripts and plugins.

Customize Your Maintenance Page

If you want to enhance the user experience during maintenance periods, you can create a custom maintenance page instead of relying on the default WordPress maintenance mode screen. Using a plugin like Coming Soon & Maintenance Mode Page, you can easily change your maintenance mode page to one that looks like your maintenance is intentional. This allows you to inform visitors about any real maintenance and provide alternative ways to stay connected with your site, such as signing up for a newsletter or following your social media accounts.

Conclusion

Dealing with WordPress being stuck in maintenance mode can be a frustrating experience for both website owners and visitors. By taking preventive measures and following best practices for updates and performance optimization, you can minimize the chances of encountering maintenance mode problems in the future.

We hope this article helped you get your WordPress out of maintenance mode. If it did, please let us know with a comment below. You can also share this post online if you know of others that have the same issue. Thank you.

Leave a Comment