Troubleshooting · Troubleshooting
How to Fix a Site Stuck in Maintenance Mode in WordPress
Short answer
To fix a site stuck in maintenance mode, delete the .maintenance file from the WordPress root folder, the same folder that holds wp-config.php. You can also run wp maintenance-mode deactivate over SSH. Then clear every cache, finish the update that was cut short, and check Dashboard → Updates for anything half installed.
Key takeaways
- WordPress creates .maintenance at the start of every update and deletes it at the end.
- The file holds one line: a PHP timestamp of when the update started.
- WordPress ignores a .maintenance file older than about 10 minutes.
- The maintenance page returns HTTP 503, which tells search engines the downtime is temporary.
- Deleting the file is safe; WordPress recreates it at the next update.
What is WordPress maintenance mode?
Maintenance mode is a short built-in state WordPress enters while it replaces plugin, theme, or core files.
Maintenance mode is built into WordPress core and was introduced in version 3.0, Kinsta's guide explains. While an update runs, visitors see "Briefly unavailable for scheduled maintenance. Check back in a minute." instead of the site.
WordPress uses the wp_maintenance() function and creates a temporary .maintenance file during the update, then removes the file when the update ends, Kinsta's guide explains.
The maintenance page returns a 503 status code by default, which tells search engines the downtime is temporary, Kinsta's guide explains. A short 503 does not harm rankings, but one that lasts for days can lower how often crawlers visit.
Maintenance mode also stops some background tasks while files change, so a scheduled post or a cron job can wait until the update ends. That pause is normal, and the jobs run once the site is back.
Why does a site get stuck in maintenance mode?
A site gets stuck when the update is cut short and the .maintenance file is never deleted.
The usual causes are a server timeout, a PHP memory limit hit during a bulk update, a lost connection, or a host that kills a long update. The update stops halfway, and the file stays behind.
WordPress checks the file age in wp_is_maintenance_mode(), the code reference explains. WP Engine notes that its maintenance mode feature deactivates on its own after 10 minutes, WP Engine's support guide explains.
So a message that lasts for hours means something else is wrong. Either a retrying update keeps writing a fresh file, or a cache keeps serving the old maintenance page.
A plugin that puts the site into maintenance mode on purpose is a different case. Those plugins use their own setting, not the .maintenance file, so deleting the file will not switch them off.
Bulk updates are the most common trigger, because one slow plugin in a batch of ten can stall the whole run. Update plugins in small groups, and watch the first group finish before you start the next.
How do you delete the .maintenance file?
Delete the .maintenance file from the WordPress root folder, and the site comes back at once.
- Open your host file manager, or connect over SFTP.
- Go to the WordPress root folder, the one that holds wp-config.php, wp-admin, and wp-content.
- Turn on “Show hidden files”, because files that start with a dot are hidden by default.
- Find .maintenance and delete it.
- Reload the site in a private window.
The file is only a flag, and deleting it is safe. WordPress recreates it at the next update, and it holds nothing but a timestamp.
If you cannot see the file, confirm you are in the right folder. A WordPress install in a subfolder keeps its own .maintenance file in that subfolder, not in the domain root.
If the site shows a 500 error after the file is gone, follow how to fix a 500 internal server error.
How do you switch maintenance mode off with WP-CLI?
WP-CLI switches maintenance mode off with one command, and it is the fastest fix when you have SSH access.
WP-CLI offers commands to enable, disable, and check maintenance mode, the WP-CLI handbook explains. Run wp maintenance-mode status first, then wp maintenance-mode deactivate:
wp maintenance-mode status
wp maintenance-mode deactivate
The command answers “Success: Deactivated Maintenance mode.” when it works, WP-CLI's documentation explains. It works by creating and removing the .maintenance file, the same file WordPress manages during updates, Kinsta's guide explains.
Run the command from the WordPress root folder. Add --path=/your/wordpress/folder if you run it from another folder.
Pick the method that fits the access you have:
| Method | What you need | When to use it |
|---|---|---|
| Host file manager | Hosting login | No SSH access |
| SFTP | FTP client and login | File manager is slow |
| WP-CLI | SSH access | Fastest, one command |
| SSH rm | SSH access | WP-CLI is not installed |
If WP-CLI says maintenance mode is not active but the site still shows the message, the file is older than 10 minutes and a cache is serving the old page. Clear the cache next.
Keep the SSH session open until the site loads again. If the command fails, the error message names the cause, such as a missing file or a permissions problem, and that message is what your host needs to help.
What if the site still shows the message after deleting the file?
If the message stays after the file is gone, a cache is serving the old page, or an update keeps recreating the file.
- Purge the page cache in your caching plugin, then the CDN cache.
- Reload the site in a private window to skip the browser cache.
- Check whether the .maintenance file came back. If it did, an automatic update is retrying.
- Look for a plugin maintenance screen, which uses its own setting, not the .maintenance file.
- Ask the host whether a server cache still holds the maintenance page.
A plugin maintenance screen looks similar but behaves differently. Open the plugin settings and switch its maintenance mode off, because deleting the .maintenance file cannot switch it off.
You can also replace the default message with your own page. A file called maintenance.php in wp-content is shown instead of the default sentence while .maintenance is in effect, Kinsta's guide explains.
The same message has its own short guide at briefly unavailable for scheduled maintenance, which covers the same file check.
What if the update only half finished?
A half-finished update can leave a plugin broken even after the maintenance message is gone.
Open Dashboard → Updates and run any update that did not complete. If a plugin now shows an error, deactivate it, delete it, and install a fresh copy of the same version.
Check the site front end page by page. A half-updated plugin can break one feature while the rest of the site looks fine, so open the pages that use it.
If the database connection fails after the update, see how to fix error establishing a database connection.
If the damage is wide, restore a backup with UpdraftPlus instead of patching files one by one.
How do you confirm the site is back?
The site is back when the home page and the dashboard load normally in a private window.
- Reload the home page in a private window and confirm it loads.
- Log in to wp-admin and confirm the dashboard loads.
- Open Dashboard → Updates and confirm no update is stuck halfway.
- Open one post and one page that use the updated plugin.
- Check that the .maintenance file is gone from the site root.
Watch the site for a day after the fix. If the message returns, an automatic update is failing on a schedule, and the update log will name the plugin.
If the dashboard shows a warning about the update, read it before you click anything. A warning that names a plugin tells you which update to run again, and running it alone is safer than running the whole batch.
What mistakes should you avoid?
Most maintenance mode problems drag on because the cache was never cleared, or the failed update was never finished.
- Deleting the file and never finishing the update that was cut short.
- Editing wp-config.php or the database when only the .maintenance file was the problem.
- Forgetting to purge the CDN cache after deleting the file.
- Running WP-CLI as root and leaving files with the wrong owner.
- Leaving a plugin maintenance screen switched on and blaming the .maintenance file.
Frequently asked questions
Is it safe to delete the .maintenance file?
Yes. The file holds only a timestamp, and WordPress recreates it at the next update. Deleting it ends maintenance mode at once. After deleting it, finish the update that was cut short, because the file was left behind by an update that never completed.
Why does my site keep going back into maintenance mode?
An automatic update is probably retrying and failing on a schedule, which writes a fresh .maintenance file each time. Check Dashboard → Updates for the failing update, and look at the update log or ask your host why it fails. Fix the update itself, not just the file.
How long should maintenance mode last?
A normal update holds maintenance mode for seconds, and WordPress ignores a .maintenance file older than about 10 minutes. If the message lasts longer than that, an update was cut short or a cache is serving the old page. Delete the file, clear every cache, and finish the update.
Can I turn off maintenance mode from the WordPress dashboard?
No, not while the file is fresh, because the dashboard sits behind the same maintenance message. Use your host file manager, SFTP, or WP-CLI to delete the file or run the deactivate command. Once the site loads again, finish the update from Dashboard → Updates.
What is the difference between maintenance mode and a coming soon page?
Maintenance mode is for a live site that is briefly offline for updates, and it returns a 503 status that tells search engines the downtime is temporary. A coming soon page is for a new site before launch, and it returns a 200 status so search engines can index it.
Sources
- WordPress Maintenance Mode: How to Enable It Kinsta
- wp maintenance-mode deactivate WP-CLI Command
- How to Put the Site in Maintenance Mode Make WordPress WP-CLI
- Enable Maintenance Mode WP Engine Support
- wp_is_maintenance_mode() WordPress Developer Resources
- wp maintenance-mode WP-CLI Command
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
