HiBlog WordPress

How to Fix WordPress Stuck in Maintenance Mode

  • A. MounesiAuthor
  • Release Date
  • 5 minutesReading time
  • 4Views
  • A. Mounesi
  • Published:
  • 5 min read
  • 4 views
How to Fix WordPress Stuck in Maintenance Mode

You updated several plugins at once, closed the page halfway through or your internet dropped, and now everyone who opens your site sees just one sentence: “Briefly unavailable for scheduled maintenance. Check back in a minute.” A minute has passed, ten minutes have passed, and the site still hasn’t left maintenance mode!

In this guide we explain why WordPress goes into maintenance mode, why it sometimes gets stuck there and how to bring the site back in a minute by deleting or renaming one small file, in cPanel or with WP-CLI.

Short answer: during an update, WordPress creates a file called .maintenance in its install folder and deletes it when the update finishes. If the update is cut off, the file stays. First make sure no update is still running, then show hidden files in cPanel’s File Manager and rename .maintenance to .maintenance.bak.

What is WordPress maintenance mode?

When you update the core, a plugin or a theme, WordPress puts the site into maintenance mode for a few seconds so nobody sees a half-broken site while the files are being replaced. To do this it creates a hidden file called .maintenance in the main WordPress folder and deletes it when the update is done.

If the update is interrupted, for example by closing the page, a dropped connection or PHP running out of time, the file isn’t deleted and the site stays in that mode. WordPress also records when the file was created and usually ignores it once it’s more than ten minutes old, so if the message is fresh, wait a few minutes.

If the update is still running, wait; once it has stopped, check the site’s temporary file

Before you do anything

  • Make sure the update has finished: if the update page is open in another tab and still working, wait. Deleting the file in the middle of an update makes things worse.
  • Make sure the message comes from WordPress itself: if the page has a logo or custom text, a Coming Soon or Maintenance plugin may be switched on; turn it off in that plugin’s settings.
  • Make sure it’s the maintenance message: if you see a 503 error without this sentence, the problem is something else; see How to Fix a 503 Service Unavailable Error in WordPress.

Take WordPress out of maintenance mode in cPanel

  1. Log in to cPanel (if you don’t know the address, see How to Log In to cPanel) and click File Manager in the Files section.
  2. Click Settings at the top of the page, tick Show Hidden Files (dotfiles) and click Save, so files that start with a dot become visible.
  3. Go to the WordPress install folder: usually public_html, or a subfolder such as public_html/shop if you installed WordPress there. The right folder is the one where wp-admin and wp-includes sit side by side.
  4. Right-click the .maintenance file, choose Rename and change its name to .maintenance.bak. The site comes back at once, and the file stays for you to look at.
Turning on Show Hidden Files in the cPanel File Manager settings
Renaming the .maintenance file to .maintenance.bak in the WordPress install folder

Don’t touch the .htaccess and wp-config.php files. If there’s a file called maintenance.php in the wp-content folder, it only customises how the maintenance page looks and isn’t why the site is stuck.

With WP-CLI in a terminal

If you have cPanel’s Terminal or SSH access and WP-CLI is installed, check the status in the WordPress install folder and turn maintenance mode off:

cd ~/public_html
wp maintenance-mode status
wp maintenance-mode deactivate

After the site is back

  • Open the site in a private window. If you still see the maintenance message, clear your cache plugin’s or CDN’s cache.
  • Log in to the dashboard, go to Dashboard → Updates, see which plugin, theme or WordPress itself was left half-updated and update it once more, on its own.
  • If after that you see a white screen or a WordPress critical error, a plugin’s update was left incomplete; see How to Fix the WordPress White Screen of Death.

How to avoid getting stuck in maintenance mode again

  • Update plugins one at a time or a few at a time, not all at once.
  • Don’t close or leave the page until the update has finished.
  • Back up the site before big updates.

FAQ

I renamed .maintenance but it came back. Why?

It means an update, probably a WordPress or plugin auto-update, is still running or keeps starting again. Wait a few minutes; if it happens again, send the time to support in a ticket.

I can’t see the .maintenance file. What should I do?

First check that Show Hidden Files is on and that you’re in the right folder. If the file really isn’t there, the message comes from a Coming Soon plugin or an old cache.

WordPress hosting at HiData

On HiData’s professional cPanel hosting, File Manager and Terminal are right there in your cPanel, and if an update breaks something, the host’s daily, weekly and monthly backups take the site back; restores are free, too. Whenever you get stuck, our 24/7 ticket support has your back!

Share Post

hidata.org/en/blog/fix-wordpress-stuck-in-maintenance-mode/
In Social Media

Add Comment

Related Articles