TechEarl

Fix "Briefly Unavailable for Scheduled Maintenance" in WordPress

WordPress stuck on "Briefly unavailable for scheduled maintenance" means a .maintenance file got left behind by an interrupted update. Delete it and the site comes back.

Ishan Karunaratne⏱️ 8 min readUpdated
Share thisCopied
Fix the WordPress "Briefly unavailable for scheduled maintenance" error by deleting the leftover .maintenance file in the site root, plus how to stop it recurring.

When WordPress shows "Briefly unavailable for scheduled maintenance. Check back in a minute," delete the .maintenance file in the site root and the site comes back immediately:

bash
rm /var/www/html/.maintenance

That single dotfile is the entire cause. WordPress writes it at the start of every core, plugin, or theme update, and removes it when the update finishes. If the update was interrupted (a PHP timeout, a fatal error, a closed browser tab mid-upgrade, a hosting process kill), the file never gets deleted and the whole front end and admin stay locked behind the maintenance message.

Why the page is stuck

The mechanism is in WordPress core. Before an update starts, the upgrader writes a file named .maintenance to the install root with a single line of PHP setting $upgrading to the current Unix timestamp. On every request, wp_maintenance() runs early and calls wp_is_maintenance_mode(), which reads that file. If the file exists and the timestamp is less than 10 minutes old, WordPress serves the maintenance HTML and exits before rendering anything else.

So two things have to be true for you to see the message:

  • The .maintenance file exists in the site root.
  • Its timestamp is within the last 600 seconds.

That 10-minute window is why the message sometimes clears on its own: once the timestamp ages past 600 seconds, wp_is_maintenance_mode() treats the marker as stale and lets the site render again. But the file is still sitting there, and the next update will overwrite it with a fresh timestamp, so "it fixed itself" is not a fix. Delete the file.

Delete the file

The file is a dotfile (leading dot), so it is hidden from a plain ls. List it explicitly:

bash
ls -la /var/www/html/.maintenance
code
-rw-r--r-- 1 www-data www-data 26 Mar 30 09:12 /var/www/html/.maintenance

Then remove it:

bash
rm /var/www/html/.maintenance

Reload the site. It should render immediately, no cache clear, no restart needed.

Your site root is wherever wp-config.php and wp-load.php live. On a stock Apache or nginx box that is often /var/www/html; on managed hosting it might be ~/public_html or ~/htdocs. The .maintenance file sits in that same directory, alongside wp-admin/ and wp-content/.

No shell access? Use FTP or the file manager

If you are on shared hosting with no SSH, connect over SFTP/FTP or open the host's file manager, navigate to the site root, and delete .maintenance. The one thing to watch: most FTP clients and file managers hide dotfiles by default. In FileZilla it is Server → Force showing hidden files; in cPanel File Manager it is the Settings toggle for "Show Hidden Files (dotfiles)." Without that, the file is there but invisible and you will swear the directory is clean.

What you actually see

The message is plain, unstyled HTML that WordPress hardcodes in wp_maintenance(). No theme, no header, no footer, just:

code
Briefly unavailable for scheduled maintenance. Check back in a minute.

Both the front end and /wp-admin show it, which is what makes it feel like the whole site is down. It is not down; the files and database are fine. WordPress is deliberately short-circuiting every request until the marker file is gone.

A nicer maintenance page (optional)

If you drop a file named maintenance.php into wp-content/, WordPress loads that instead of the bare one-liner whenever maintenance mode is active. This is the supported way to brand the page (the wp_maintenance() function checks for WP_CONTENT_DIR/maintenance.php before falling back to the default). A minimal version:

php
<?php
http_response_code(503);
header('Retry-After: 600');
?>
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Updating</title></head>
<body>
  <h1>We are applying updates</h1>
  <p>The site will be back in a minute. Thanks for your patience.</p>
</body>
</html>

Returning 503 Service Unavailable with a Retry-After header is the correct signal here: it tells search engine crawlers the outage is temporary so they do not deindex the page. The default WordPress maintenance response does send a 503 already, so a stuck .maintenance file is not a long-term SEO problem unless it stays stuck for days.

Stop it from happening again

The leftover file is a symptom. The update failed partway through, usually for one of these reasons:

CauseSymptomFix
PHP max_execution_time too lowLarge update times out mid-writeRaise to 120s+ in php.ini or via host panel
Memory exhaustionWhite screen during update, then stuckRaise WP_MEMORY_LIMIT / PHP memory_limit
Updating many items at onceBulk plugin update dies on one itemUpdate plugins one at a time
Closed the tab mid-updateBrowser-driven update never finishedLet updates run to completion
Disk fullUpdate can't write, leaves markerFree space, then delete .maintenance

After deleting .maintenance, finish the job WordPress abandoned. Re-run the update that failed, because an interrupted core update can leave the database schema and the files out of step. The cleanest way is WP-CLI, which does not depend on a browser tab staying open:

bash
wp core update
wp plugin update --all
wp theme update --all

If wp core update reports you are already on the latest version but the site behaves oddly, force the file refresh:

bash
wp core update --force

Toggle maintenance mode on purpose

If you want maintenance mode deliberately (not the accidental stuck kind), WP-CLI manages the same marker file cleanly:

bash
wp maintenance-mode activate
wp maintenance-mode status
wp maintenance-mode deactivate

activate writes the .maintenance file with the current timestamp; deactivate removes it. This is the right tool when you are about to do manual surgery on the database or files and want the site to show the maintenance page on purpose. It saves you from hand-creating and hand-deleting the dotfile, and status tells you whether the marker is currently present.

See also

Sources

Authoritative references this article was fact-checked against.

TagsWordPresstroubleshootingmaintenance modePHPwp-cli

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Tech Architect · Software Engineer · AI/DevOps

Tech architect and software engineer with 20+ years building software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Currently Chief Technology Officer at a healthcare tech startup, which is where most of these field notes come from.

Keep reading

Related posts

Using AI to Update ACF Fields and WordPress Content

AI plus WP-CLI plus ACF is the canonical pattern for bulk content updates that used to take a careful afternoon. Schema-aware update_field calls, content rewrites at scale, image alt backfills, and the safety patterns that prevent disasters.

Fix NODE_MODULE_VERSION Mismatch in Node.js

The NODE_MODULE_VERSION mismatch error means a native addon was compiled against a different Node ABI than the one now running it. Here is what the numbers mean, the one-line fix, and the Electron, Docker, and CI variants that catch people out.