WordPress stuck in maintenance mode: the one-file fix, and why it happened

Briefly unavailable for scheduled maintenance means one leftover file. Delete it to restore the site, then check the half-finished update that caused it.

Our content is written and reviewed by the Four Cents team. We may recommend our own services. Read our editorial standards.

On this page

The fix, in one minute

Delete the file called .maintenance from your WordPress root, the directory containing wp-config.php and wp-admin. The site comes back as soon as it is gone.

# over SSH, from the WordPress root
ls -la .maintenance
rm .maintenance

Over FTP or in a host file manager, you must turn on showing hidden files first, because a leading dot hides it by default. In cPanel's File Manager it is Settings, then Show Hidden Files. In FileZilla it is Server, then Force showing hidden files.

That is the whole fix for the symptom. Now the part that actually matters.

Why it happened

Before an update, WordPress writes .maintenance containing a timestamp. While it exists and is recent, every front-end request gets the maintenance notice instead of your site. When the update finishes, WordPress deletes it.

If the update never finishes, nothing deletes it. The usual interruptions:

  • PHP timed out partway through, which is the most common on shared hosting and most likely when updating many plugins at once
  • Memory limit hit while unpacking
  • The browser tab was closed or the connection dropped during a bulk update
  • A file could not be written because of permissions or ownership
  • The host killed the process for exceeding a resource limit

Note what all of these have in common: the update stopped in the middle. That is why deleting the file is the start of the job and not the end.

Thinking about a new WordPress website?Get a free consultation and a fixed-scope quote. A senior engineer replies within 24 hours. No obligation.
Get a Free Quote

The important part: what the interrupted update left behind

The maintenance notice was a symptom. Something was being upgraded when the process died, and it is now in an unknown state: new files partly copied, or files updated while the database migration never ran.

Work through this once the site is back.

  1. Find out what was mid-update. Check the updates screen, and your error log around the time it stopped.
  2. Reinstall whatever it was, cleanly. Do not assume partial files are fine.
  3. Let WordPress finish any database work. Visiting /wp-admin/upgrade.php prompts core to complete a pending database update.
  4. Check the site properly, especially anything that plugin touches: checkout, forms, bookings.
  5. Then update the rest one at a time, so the next failure is immediately attributable.
# what still needs updating
wp core check-update
wp plugin list --update=available --fields=name,version,update_version

# force a clean reinstall of the one that was interrupted
wp plugin install the-plugin-name --force

# confirm core files match the official release
wp core verify-checksums

That last command is the quickest way to know whether an interrupted core update left damaged files. Anything reported as not verifying should be fixed with wp core download --force --skip-content, which overwrites core and leaves your content alone.

If a plugin is now throwing a fatal error, the site may be white rather than in maintenance mode, which is a different problem with a different fix. Read the error log first; it names the file.

Preventing it

This is almost entirely avoidable, and the measures are cheap.

MeasureWhy it works
Update in batches of three or fourEach batch finishes inside the time limit. Bulk-updating twenty is the classic trigger
Keep the tab open until it completesThe request is doing the work; closing it can end the process
Update core on its ownIt is the longest operation and the worst one to interrupt
Use WP-CLI where you have itNo browser request to time out, and clearer errors
Raise PHP time and memory limitsRemoves the usual cause on shared hosting
Back up firstTurns a bad outcome into an inconvenience
Do not update right before you leaveThe failure mode is a site that is down until somebody looks

If you are on a slow shared host and see this repeatedly, the underlying issue is usually resource limits rather than WordPress. An outdated PHP version is often part of it too; see PHP end of life and your WordPress site.

Ready to bring your WordPress project to life?Get a free consultation and a fixed-scope quote. A senior engineer replies within 24 hours. No obligation.
Get a Free Quote

If deleting the file does not fix it

Then the maintenance notice was not what was stopping the site. Three possibilities, in order of likelihood.

  • A fatal error from the half-updated plugin or theme. Read the log; it names a file and a line.
  • A caching layer still serving the maintenance page. Clear the page cache and any CDN, and check in a private window.
  • A plugin-generated maintenance mode, which is a different mechanism from WordPress's own and is switched off in that plugin's settings.
# the usual log locations
tail -50 wp-content/debug.log
tail -50 ../logs/error_log

# if the site is white, disable plugins until it loads
wp plugin deactivate --all
wp plugin activate one-plugin-at-a-time

Deactivating all plugins is a diagnostic, not a fix. It tells you which plugin is responsible in a couple of minutes, and you reactivate the rest as you go.

If the site is down and an update has left it in a state you cannot unpick, that is worth handing over rather than experimenting on production. Tell us what you were updating when it stopped and we will get it back and tell you why it failed.

Frequently asked questions

How do I fix WordPress stuck in maintenance mode?

Delete the file named .maintenance from your WordPress root directory, using FTP, your host file manager, or the command line. The site returns immediately. It is a dot file, so enable showing hidden files if you cannot see it.

Why did WordPress get stuck in maintenance mode?

WordPress creates .maintenance before an update and removes it after. If the update is interrupted, by a timeout, a memory limit, a dropped connection or closing the tab, the file is never removed and the site stays in maintenance mode.

Is it safe to delete the .maintenance file?

Yes. It contains only a timestamp and exists to tell WordPress to show the maintenance notice. The real question is whether the interrupted update left a plugin half-upgraded, which is what to check next.

The site is back but a plugin is broken. What now?

The update was interrupted partway. Reinstall that plugin cleanly rather than trusting the partial files, check the database version, and update the remaining plugins one at a time so you can see which one failed.

How do I stop it happening again?

Update in small batches rather than all at once, keep the tab open until each finishes, raise the PHP time limit and memory if your host allows, and take a backup first. Bulk-updating twenty plugins on a slow host is the usual trigger.

I deleted the file and the site is still down. Why?

Then the maintenance notice was not the problem, it was a symptom. Look for a fatal error from the half-updated plugin or theme by reading the error log, and if necessary disable plugins until the site loads.

About the author

Hamza Hai

Founder, Accountant & Project Manager, Four Cents

Hamza Hai is a founder of Four Cents and its accountant and project manager. She keeps projects on track and the numbers clear.

She manages timelines, scope and client communication, so there are no surprises for clients along the way.

She writes the guides on WPDeveloper.ca, including its WordPress planning guides. They draw on the quoting and scoping work she does for Four Cents clients every week.

Areas of expertise

  • Software and app project management
  • Development costing and estimates
  • Project scoping
  • Budgeting for software projects

All articles by Hamza Hai (140 on Four Cents WordPress Studio)

Reviewed by Zee, Founder & Lead Developer, Four Cents

Zee leads every Four Cents build as the senior full-stack engineer, from the first call to launch and beyond, and technically reviews the articles on this site.

Our editorial standards: who writes and reviews our articles, where our prices come from and how to report a correction.

Start here

Get a fixed quote in 24 hours

Tell us what is wrong or what you need. Within 24 hours you get a written, fixed price or the questions we need answered to give you one.

  • A reply within 24 hours
  • Fixed price agreed before any work starts
  • You own the code, content and accounts

Site down or hacked right now? Call +1 (365) 440-1786 or email info@fourcents.ca.

Request your fixed quote

Fields marked with an asterisk are required. Phone and budget are optional.

Please enter your name.

Please enter a valid email address.

Please tell us a little more (10 characters or more).

That phone number does not look right. Check it, or leave it blank.