How to Fix WP Maintenance Loop (Stuck WordPress Maintenance Mode Screen)

wordpress website broken

Does your WordPress site appear to behaving like a problem child?

I’m not a fan of WordPress, however I do often recommend it for many online applications. One of it’s “quirks” which plagues any web master multi-tasking many sites at once or if you are using a tool such as MainWP to manage your updates, is a loop where you get stuck in Maintenance mode and you can’t login, restart your server to get out of it.

WordPress Maintenance Mode Loop of Death?

Trust me this is common and it happens to just about everyone at some point, Each CMS has its own unique idiosyncrasies that we don’t discuss in this whitepaper. Here we will show you a method for how to manually access WordPress in the event that it is inadvertently put into maintenance mode loop. We’ll cover the following:
  1. Identifying the right alert message
  2. What causes WordPress to get stuck in maintenance mode
  3. How to get your wordpress website unstuck
  4. How to stop this from happening in the future

What can cause WordPress to get stuck in a maintenance mode loop?

When active, WordPress has a maintenance mode that it turns on whenever you update your WordPress apps, themes, and plugins. You can see a message alert you about upgrading when you run an update on your WP CMS website. Most of the time, when your site is in maintenance mode for only a few seconds and you won’t notice it and the working site state will be as if nothing happened. Often, things do go wrong with these potential triggers being the root cause:
  • You mistakenly closed your browser tab when a preview of an update was occurring.
  • You’re trying to incorporate a large number of plugins within a limited period of time.
  • An incompatibility exists and induces an anomaly.
  • As a consequence, this alert message will continue to appear when you go to your site.
    Briefly unavailable for scheduled maintenance. Check back in a minute.

    If you see the WordPress Maintenance alert, there’s an easy fix

    Get WordPress out of Maintenance mode instructional Guide

    WordPress will make sure maintenance has been done when it generates a file called “.maintenance” in your WordPress folder. This is the document root folder that contains all your public files and folders for your website, often titled public_html or the domain our your website. Some common files and folders to see in there are: wp-admin folder, index.php, wp-config.php. If you are looking for the file via your hosting panel, such as Cpanel, you will need to make sure your settings are set to show hidden files. Like the diagram below. In Cpanel (What we use exclusively at mebsites hosting) you’ll find the settings button in the top right hand corner of the page when in the file manager from the Cpanel home page. Mebsites support will help you with this if you need it. Figure 1. Changing Hidden files to be viewed in Mebsites Hosting Cpanel Alternatively, you can access your file directory via an FTP or SFTP client. To stop the loop: Locate the file, highlight it and delete it. Once you have deleted the file return to your website page and refresh the page (Control F5 if on windows). You should now see your website running again. In some case you may need to delete your browser cache and history as well depending on your server caching settings.

    How can I keep WordPress from being permanently logged in maintenance?

    1. Firstly, do not leave your browser tab while updating and especially do not close the tab. Unfortunately, this is just one of times you need to sit and wait. Additionally, ensure your internet connection is stable and not dropping out before you start.
    2. Ensure the version of PHP you are running is compatible with your new updates. You can find your version of php in Cpanel, by viewing info.php file if you have one, checking with your hosting support or looking on your WordPress dashboard.
    3. Ensure all plugins are compatible with your php version and the new version of wordpress you maybe updating to. You can find this out by login into wordpress and navigating to Plugins-> page then clicking on details for any plugins you want to check.
    4. Avoid using the Update All function. Yeah, I know this sounds stupid, why does WordPress have an update all button if it can’t update all without breaking half the time. Well that’s is the reality of it. If you only manage one site it isn’t such a big deal, but when you manage hundreds or thousands of sites it makes a one minute job into a multi day exercise and well that is just what has to happen if you want to avoid more work. If you use a tool like MainWP to manage many sites, we recommend doing updates separately in batches preferably not all on the same server to give your hosting plenty of resources to get the job done and not glitch or hang.