Your WordPress site shows “Briefly unavailable for scheduled maintenance. Check back in a minute.” on every page, and the minute passed long ago. This page is for whoever has to bring that site back, on cPanel or any other Linux host. The message comes from a hidden file called .maintenance in the WordPress root, written when an update starts and normally deleted when it ends. An update died partway through, so the file stayed behind. Delete the file, then check what the broken update left half-installed, because that part is still broken after the message goes away.
What you’ll accomplish
- Confirm the message really comes from WordPress core, not from a plugin, your host or Cloudflare.
- Read the
.maintenancetimestamp and know whether an update is still running or long dead. - Remove the file with cPanel File Manager, SSH or WP-CLI.
- Find half-copied core or plugin files and a database schema that lags behind the code, and repair both.
- Make the next update finish cleanly.
Prerequisites
- Access to the site files: cPanel File Manager, SFTP, or SSH (cPanel’s Terminal works). SSH is fastest.
- WP-CLI, the
wpcommand, for the checks in steps 5 to 9. Thewp maintenance-modecommand ships with WP-CLI 2.2 and newer; check withwp --info. Without WP-CLI you can still remove the file and use the cPanel screens. - The WordPress root path. On cPanel it is usually
~/public_html; on a plain LAMP server often/var/www/html. If WordPress lives in a subfolder, the root is the folder that holdswp-config.php. - A current backup or restore point before step 7, which can change the database.
Every command runs as the site’s own system user from the WordPress root. date -d is GNU date; macOS uses date -r.
How it works
WordPress has no maintenance setting in the database. It has a file. When a core, plugin, theme or translation update starts, the updater writes .maintenance into the WordPress root with one line in it:
<?php $upgrading = 1792806737; ?>
The number is a Unix timestamp, the second the update began. On every page load, wp_is_maintenance_mode() in wp-includes/load.php looks for this file. It lets the request through if the file is missing, if WordPress is installing, or if the timestamp is 10 minutes old or more. Otherwise WordPress answers with HTTP 503, a Retry-After: 600 header and the familiar sentence. When the update finishes, the updater deletes the file.
That 10-minute expiry changes the diagnosis. A file left behind by a crash stops blocking visitors by itself after ten minutes. If you still see the message an hour later, one of four things is true. Something keeps rewriting the file, usually an automatic update retrying. The timestamp is in the future because of a wrong server clock or a plugin that wrote its own value. A page cache or CDN stored the 503 and keeps replaying it. Or the page is not coming from core at all.
The update also leaves debris in other places, shown below. WordPress unpacks each download into wp-content/upgrade/. Since WordPress 6.3, before replacing a plugin or theme it moves the old copy into wp-content/upgrade-temp-backup/, and moves it back if the install fails. If PHP is killed before that cleanup runs, the plugin folder can be missing while its old copy sits in the backup folder.
One escape hatch matters. wp-admin/upgrade.php marks itself as installing, so it stays reachable even while .maintenance is on disk. That is how WordPress finishes its own database work, and you can use it the same way.
Look-alikes: plugin, host and Cloudflare pages
Several other screens say “maintenance”. They need different fixes.
- WordPress core. HTTP 503, a
retry-after: 600header, a page titled “Maintenance” with the exact sentence above. A.maintenancefile exists in the root. - A custom drop-in. If
wp-content/maintenance.phpexists, WordPress shows that file instead of its sentence. The status and header are the same, and the trigger is still.maintenance. Host-specific wordings usually come from here. - A maintenance or coming-soon plugin. Its own design, often your logo, and no
.maintenancefile. Turn it off in that plugin’s settings, or deactivate the plugin. - A host or Cloudflare page. Served before PHP runs, so there is no file to find. Cloudflare pages carry a
cf-rayheader and a Ray ID at the bottom. Your host’s status page or support team owns that one.
Step-by-step
-
Confirm the 503 comes from WordPress. Ask for headers and the page body:
curl -sI https://example.com/ | grep -iE '^(HTTP|retry-after|cf-ray|age|x-litespeed-cache)' curl -s https://example.com/ | grep -o 'Briefly unavailable[^<]*'Example output:
HTTP/2 503 retry-after: 600 Briefly unavailable for scheduled maintenance. Check back in a minute.503withretry-after: 600is core’s response. A200with the sentence in the body, or anageorx-litespeed-cache: hitheader next to the 503, means a cache is answering. Skip to step 8 after step 2. No sentence and noretry-aftermeans one of the look-alikes above. -
Find the file, which is hidden. Files starting with a dot do not appear in a normal listing.
ls -la ~/public_html/.maintenance cat ~/public_html/.maintenance date -d @1792806737Example output:
-rw-r--r-- 1 examplco examplco 33 Oct 23 21:52 /home/examplco/public_html/.maintenance <?php $upgrading = 1792806737; ?> Fri Oct 23 21:52:17 EDT 2026Put your own number in the
datecommand. In cPanel File Manager, click Settings at the top right and tick “Show Hidden Files (dotfiles)” or the file will not be listed. Under ten minutes old means an update may still be running, so wait and check again. A date in the future points to a clock or plugin problem; the 10-minute expiry will never rescue you there.No such file or directorymeans core maintenance is not the cause; see the look-alikes section. -
Read the error log before you delete anything. The log says what killed the update, which decides how you prevent the next one.
grep -iE 'fatal|allowed memory|maximum execution|disk quota|no space left' ~/public_html/error_log | tail -20Allowed memory size of ... bytes exhausted: PHP hit its memory limit during the update.Maximum execution time of 30 seconds exceeded: PHP stopped the request mid-copy. Common for core updates on slow shared storage.Disk quota exceededorNo space left on device: the account filled up while unpacking.Uncaught Errorwith a path underwp-content/plugins/: the new plugin code crashed on load before the updater could clean up.- Nothing at all: the process was killed from outside PHP, such as a process limit or a closed browser tab during a manual update. In cPanel, Metrics then Errors shows the web server side.
Also check the disk: cPanel Files then Disk Usage, or
quota -sover SSH if your host enables it. -
Remove maintenance mode. With WP-CLI:
wp maintenance-mode status wp maintenance-mode deactivateExample output:
Maintenance mode is active. Disabling Maintenance mode... Success: Deactivated Maintenance mode.WP-CLI applies the same 10-minute rule as WordPress. For an older file it prints
Maintenance mode is not active.anddeactivatefails withError: Maintenance mode already deactivated., yet the file is still there. Delete it directly in that case:rm -f ~/public_html/.maintenance ls -la ~/public_html/.maintenanceSuccess is
ls: cannot access '/home/examplco/public_html/.maintenance': No such file or directory. In File Manager, select.maintenancein the WordPress root and click Delete. Do not rename it to.maintenance.bakand leave it, since a later restore can bring it back. -
Check whether core and plugin files are complete. This is the step most fixes skip.
wp core verify-checksums wp plugin verify-checksums --allExample output for a clean site:
Success: WordPress installation verifies against checksums. Success: Verified 14 of 14 plugins.A core copy that stopped halfway looks like this:
Warning: File doesn't verify against checksum: wp-includes/version.php Warning: File doesn't exist: wp-includes/blocks/index.php Error: WordPress installation doesn't verify against checksums.The plugin check prints a table of failing files and ends with
Error: Only verified 13 of 14 plugins (1 failed).It only covers plugins from WordPress.org; premium plugins show as skipped and need a fresh copy from the vendor. -
Look for leftovers in wp-content.
ls -la ~/public_html/wp-content/upgrade/ ~/public_html/wp-content/upgrade-temp-backup/plugins/ 2>/dev/null ls ~/public_html/wp-content/plugins/ wp plugin list --update=available --fields=name,version,update_versionFolders inside
upgrade/are unpacked downloads. They are safe to delete, and WordPress clears the folder on the next update anyway. A folder insideupgrade-temp-backup/plugins/is the old copy of a plugin whose update did not finish. If the same name is missing fromwp-content/plugins/, WordPress cannot load that plugin, so its features are gone from the site. A plugin still listed under--update=availableis one whose update never landed. -
Compare the database schema with the code. A core update copies files first and upgrades the database after. If it died in between, new code runs against an old schema.
wp option get db_version wp eval 'global $wp_db_version; echo $wp_db_version, PHP_EOL;'Both lines should print the same number. Example output after a failed jump from 6.9 to 7.1:
60717 61833Different numbers mean the database step never ran. Fix it:
wp core update-dbSuccess: WordPress database upgraded successfully from db version 60717 to 61833.Without a shell, open
https://example.com/wp-admin/upgrade.phpwhile logged in and click the button. On multisite, usewp core update-db --network. -
Finish or roll back what failed. For core files that failed step 5, reinstall the version you are on:
wp core version wp core update --version=7.1.3 --forceExample output:
7.1.3 Updating to version 7.1.3 (en_US)... Downloading update from https://downloads.wordpress.org/release/wordpress-7.1.3-no-content.zip... Unpacking the update... Success: WordPress updated successfully.Use the number
wp core versionprinted. For a plugin, either complete the update withwp plugin update woocommerce, or put back the old copy from step 6:mv ~/public_html/wp-content/upgrade-temp-backup/plugins/woocommerce ~/public_html/wp-content/plugins/ wp plugin activate woocommercemvwill not move onto a folder that still has files in it, so delete a half-copied plugin folder first. Rolling back restores files only. If the newer version already changed the database, follow the vendor’s downgrade notes or restore the database.Then empty the caches that may still hold the 503:
wp cache flush, then purge your page cache plugin and your CDN from their own screens. -
Stop it from happening again. Raise the limits that killed the run. In cPanel, open Software then MultiPHP INI Editor, pick the domain, and set
max_execution_timeto 300 andmemory_limitto 512M. Free disk space if step 3 showed the quota was full.If an unattended update failed, turn plugin auto-updates off and update by hand, one plugin at a time:
wp plugin auto-updates disable --all wp plugin update woocommerceSuccess: Disabled 14 of 14 plugin auto-updates.PHP on the command line has no execution time limit by default, so large updates run through WP-CLI are not cut off at 30 seconds. The tradeoffs of switching auto-updates off, and how to keep security releases, are in disabling plugin and theme auto-updates.
Validate it works
Run these together and read every line:
curl -sI https://example.com/ | head -1
curl -sI https://example.com/wp-login.php | head -1
ls -la ~/public_html/.maintenance
wp core verify-checksums
wp plugin verify-checksums --all
wp option get db_version
wp eval 'global $wp_db_version; echo $wp_db_version, PHP_EOL;'
The site is fully recovered when both curl lines show HTTP/2 200, ls says No such file or directory, both checksum commands end in Success: with no Warning: lines, and the last two numbers match. Then log in, open the Plugins screen, and confirm nothing you rely on is inactive. Watch for ten minutes to make sure nothing writes the file again:
for i in $(seq 1 10); do date +%T; ls ~/public_html/.maintenance 2>&1 | tail -1; sleep 60; done
Every line should end with No such file or directory.
Troubleshooting
The file comes back within minutes. An automatic update is retrying. List what is scheduled, then pause automatic updates while you work:
wp cron event list --fields=hook,next_run_relative
wp config set AUTOMATIC_UPDATER_DISABLED true --raw
Look for wp_version_check, wp_update_plugins and wp_maybe_auto_update. Once the cause is fixed, remove the pause with wp config delete AUTOMATIC_UPDATER_DISABLED, because leaving security updates off for good is a worse problem. If a different update is stuck behind a lock, see another update is currently in progress.
rm says Permission denied. The file belongs to another user, often after a migration done as root. Check with stat -c '%U:%G %a %n' ~/public_html/.maintenance ~/public_html. File Manager runs as the account user and fails the same way. Your host has to fix the ownership, and that mismatch probably caused the failed update too.
The file is gone but visitors still see the message. A cache is replaying the 503. Compare curl -sI "https://example.com/?nocache=$(date +%s)" | head -1 with the plain URL; a 200 on the first and a 503 on the second proves it. Purge the page cache and the CDN.
Every admin page redirects to wp-admin/upgrade.php. That is the schema mismatch from step 7, not maintenance mode. Let the page run, or use wp core update-db. If it errors, the PHP error log names the failing query; reading the WordPress error log shows where your host writes it.
The site shows HTTP 500 once the file is gone. The new code crashes. Boot WP-CLI without plugins and deactivate them all, then reactivate one at a time:
wp plugin deactivate --all --skip-plugins
The full procedure is in HTTP 500 after a plugin update.
When this is the wrong approach
If an update is really running right now, deleting .maintenance shows visitors a site whose files are being swapped under them. Check whether anything in wp-content/upgrade/ changed in the last minute, and wait if it did.
If a maintenance plugin, your host or a migration tool put the site in maintenance on purpose, deleting the file fights that tool. Turn it off where it was turned on.
On multisite, the one file takes the whole network offline, and one deletion brings it all back. The steps are the same; treat the follow-up update as planned work.
If .maintenance appeared with no update in the site’s history, treat it as evidence first. Save the stat output and the access log for that minute before you delete it, since an attacker can use the file to keep visitors away.
The WordPress page on common WordPress errors lists this message and its neighbours, and the WP-CLI maintenance-mode reference documents each subcommand.
Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.