WordPress stuck in maintenance mode: getting out, and why it happened

Get WordPress out of "Briefly unavailable for scheduled maintenance", find what shows the message when the usual fix fails, and stop it coming back.

Updated 7 min read

On this page (8)
  1. The quick fix: delete .maintenance
  2. Or wait ten minutes
  3. Still there after that? Find out what is answering
  4. Why WordPress got stuck
  5. If the update only half finished
  6. Stop it happening again
  7. A better updating page with Coming Soon and Maintenance Mode
  8. Check it worked

Delete the file called .maintenance from the folder WordPress is installed in, and the site comes back straight away. WordPress also stops honouring that file by itself once it is ten minutes old, so if "Briefly unavailable for scheduled maintenance" is still on screen after that, something other than WordPress's own update is showing it. Both cases are below, along with what to do when the update itself only half finished.

The quick fix: delete .maintenance#

While it installs an update, WordPress writes a small file called .maintenance and shows every visitor that one sentence. When the update ends, it deletes the file. If the update stops part-way, the file stays behind.

  1. Open your site's files with your host's file manager, an FTP or SFTP program, or SSH.
  2. Go to the WordPress folder: the one that holds wp-admin, wp-includes, wp-load.php and wp-settings.php. It usually holds wp-config.php too, although WordPress can also read that file from the folder above.
  3. Switch on the option to show hidden files. File managers and FTP programs often hide names that start with a dot.
  4. Delete .maintenance.
  5. Open the site in a private window. It should load as normal.

With SSH, from the WordPress folder:

rm .maintenance

Or with WP-CLI's maintenance-mode command, whose deactivate deletes the same file:

wp maintenance-mode status
wp maintenance-mode deactivate

Do not expect to fix this from wp-admin. While the file is fresh, the dashboard is behind the same message: when we tested on WordPress 7.1, /wp-admin/ and wp-login.php both answered with the 503 and the same sentence as the home page.

Or wait ten minutes#

The file holds one line of PHP: the time the update started.

<?php $upgrading = 1792682904; ?>

WordPress compares that time with the clock on every request, and once ten minutes have passed it no longer treats the site as being in maintenance (the check is wp_is_maintenance_mode() in wp-includes/load.php; see its entry in the WordPress code reference). We set the time to 601 seconds in the past on a test site: the site loaded normally, and wp maintenance-mode status said maintenance mode was not active.

So a site that has been "stuck" for an hour is either not showing WordPress's message at all, or an update is being tried again and again, each attempt writing a fresh file. Delete the file anyway. A stale one does no harm, but it tells you the last update did not finish, which is worth checking (see below).

Still there after that? Find out what is answering#

Look at what the server sends rather than at the page. From a terminal on your own computer:

curl -s -D - -o /dev/null https://www.example.com/

WordPress's own message comes back with the status 503, a retry-after: 600 header and the words "Briefly unavailable for scheduled maintenance. Check back in a minute." Anything else points somewhere else.

A different design or different words point to a maintenance or coming soon plugin that is still switched on, or to a page from your host. Such plugins often let signed-in administrators straight through, so look in a private window. To switch one off without wp-admin, rename its folder inside wp-content/plugins (WordPress skips a plugin whose file it cannot find), or run wp plugin deactivate with the plugin's folder name.

A file called wp-content/maintenance.php is a drop-in: WordPress shows it instead of its own sentence, but only while .maintenance is in effect. On our test site, with that file in place and no .maintenance, every page loaded normally. If you see that page and there is no .maintenance file, WordPress is not the one showing it.

An old copy can also come from a cache. WordPress sends its message with headers that tell caches not to keep it (cache-control: no-cache, must-revalidate, max-age=0, no-store, private in our test), but a server or CDN cache set up to ignore them can still hand it out. Empty that cache.

"There has been a critical error on this website." is a different problem: the update replaced some files and the new code fails. Go to the section on half-finished updates.

Why WordPress got stuck#

WordPress writes .maintenance just before it replaces files and deletes it at the end. It does this for every core update, and for a plugin or theme update only when that plugin is active or that theme is in use (on multisite, for any of them). Updating an inactive plugin never puts the site into maintenance.

When you update several things at once from Dashboard → Updates, the file is written once at the start of the batch and removed once at the end. If the request doing the work stops before the end, because it hit PHP's time or memory limit or the server restarted, the deleting step never runs. The longer the batch, the longer the window.

If the update only half finished#

  1. Go to Dashboard → Updates and run the update again. If a WordPress core update says "Another update is currently in progress.", it is waiting on a lock it keeps in the database (core_updater.lock). WordPress ignores that lock once it is 15 minutes old, and wp option delete core_updater.lock removes it at once.
  2. Check Plugins. During a plugin or theme update WordPress moves the old version into wp-content/upgrade-temp-backup/ and puts it back if the install fails. For an automatic update of an active plugin, it also checks the site afterwards and restores the old version if the new one causes a fatal error. A plugin that is still broken can be deleted and installed again from a fresh zip under Plugins → Add Plugin → Upload Plugin.
  3. If a plugin or theme crashes the site, WordPress emails the site's admin address ("Your Site is Experiencing a Technical Issue") with a link to its recovery mode, which lets you sign in and deal with the plugin or theme that failed.
  4. Open Tools → Site Health for anything still wrong.
  5. If the site will not come back, restore your last backup, files and database together.

Stop it happening again#

Update a few things at a time rather than everything at once, take a backup first, and leave the Updates screen open until it says "All updates have been completed."

You can also replace WordPress's plain sentence with a page of your own. Put a file called maintenance.php in wp-content and WordPress shows it during every update instead. Two things to know. It runs before WordPress has loaded, so it must be plain PHP and HTML. And it must send its own status code, because WordPress sends none for it: on our test site a drop-in that set nothing answered 200, which tells search engines the message is your page's content. This one sends 503 and Retry-After, and we checked both on a test site:

<?php
// wp-content/maintenance.php: WordPress shows this only while it is updating.
// It runs before WordPress has loaded, so plain PHP and HTML only.
http_response_code( 503 );
header( 'Retry-After: 600' );
header( 'Cache-Control: no-store' );
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Back shortly</title>
<style>
  body { font: 18px/1.5 system-ui, sans-serif; max-width: 32rem; margin: 15vh auto; padding: 0 1rem; color: #222; }
</style>
</head>
<body>
<h1>Back shortly</h1>
<p>We are installing an update. Please try again in a few minutes.</p>
</body>
</html>

Delete the file if you ever want WordPress's own message back.

A better updating page with Coming Soon and Maintenance Mode#

Coming Soon and Maintenance Mode can write that wp-content/maintenance.php for you, in your own design. It is off until you switch on Settings → WordPress Updates → Show your page while WordPress installs updates. Visitors then see your design, colours, logo, picture, footer text and social links while WordPress updates, with a headline and message of their own (Back in a moment and We are updating the site. Please try again in a minute. unless you change them), and search engines get a 503 with Retry-After: 60. The copy is made again whenever you save a change to the design or to those words. The Settings section of the documentation has the details.

What it does not do:

  • It never overwrites a maintenance.php that another plugin or your host put there. Updates go on showing that one, and the panel says so (The update page says maintenance.php belongs to something else).
  • If your host does not let WordPress write to wp-content, or DISALLOW_FILE_MODS is set, it cannot write the file and updates show WordPress's own message (The update page says WordPress will not let it write to wp-content).
  • The page has no sign-up form, countdown or password link, because nothing on the site can answer them in the middle of an update.
  • It does not make an update finish, and it does not delete a .maintenance file a failed update left behind. That part is still the quick fix above.

Check it worked#

  • There is no .maintenance file in the WordPress folder.
  • curl -s -o /dev/null -w "%{http_code}\n" https://www.example.com/, run from a terminal, prints 200.
  • Dashboard → Updates shows nothing half done, and Plugins lists every plugin you had before.
  • Tools → Site Health reports no critical issues.
  • Your page cache and any CDN in front of the site have been emptied, and a private window shows the live site.

The plugin for this

Coming Soon and Maintenance Mode

Put your site behind a coming soon or maintenance page and collect the email addresses of everyone waiting for it.

From $19 a year · every feature · 30-day refund

Show your own page during updatesRead the docs

A coming soon page in the Split design. On the left, the headline Our new shop opens on 1 November, a short message, a countdown of 10 days, 0 hours, 43 minutes and 31 seconds with the line Opening November 1, 2026 9:00 am, and a sign-up form headed Be the first to know with an email field and a Tell me when it opens button. A photograph of two friends in knitwear fills the right half.

In the documentation

All guides