WordPress Stuck on Maintenance Mode - Manual Cleanup

Your WordPress site was updating. A plugin update. A theme update. A WordPress core update.

It started fine. You saw "Updating..." then progress bar.

And then it stopped. No response. The page hung.

You refreshed. You got: "Briefly unavailable for scheduled maintenance. Check back in a minute."

You wait 5 minutes. Still in maintenance mode.

You wait an hour. Still in maintenance mode.

Your site is offline. Customers can't access it. You're losing sales by the minute.

WordPress is stuck in maintenance mode and won't come back.

A client called us at 2 AM. Their site had been in maintenance mode for 4 hours. A WordPress core update crashed partway through. Their customers couldn't access the site. They were panicking.

We fixed it in 3 minutes by deleting one file.

That file is .maintenance. It's WordPress's flag that says "site is currently updating, show maintenance message." When the update finishes, WordPress deletes it. But if the update fails, .maintenance stays there. And your site stays offline.

The fix is simple. Delete the file. Site comes back online immediately.


Why WordPress Gets Stuck in Maintenance Mode

Understanding the cause helps you know the exact fix.

  • .maintenance file not deleted: Update crashed, .maintenance wasn't cleaned up
  • Update process timed out: Server took too long, process was killed, .maintenance left behind
  • Database query failed: Update couldn't write to database, update halted, .maintenance remains
  • Disk space ran out: No space to write files, update stopped, .maintenance stuck
  • Plugin/theme update conflict: Active plugin broke during update, .maintenance file created but not deleted
  • Memory limit reached: PHP ran out of memory, update crashed, .maintenance left behind
  • FTP or permissions issue: Couldn't download update files, process failed
  • Hosting server issue: Server restarted during update, left .maintenance in place

In all cases, the fix is the same: Delete .maintenance file.


Step 1: Delete .maintenance File via FTP (Quickest)

This is the fastest way to get your site online immediately.

Connect via FTP

  1. Open FTP client (FileZilla, WinSCP, Cyberduck, etc.)
  2. Enter FTP credentials
  3. Click Connect
  4. Navigate to WordPress root directory

Find and delete .maintenance file

  1. Look in your WordPress root folder for a file called ".maintenance"
  2. It will be a hidden file (starts with dot)
  3. Your FTP client might hide it by default
  4. Go to View > Show Hidden Files (if needed)
  5. Right-click the .maintenance file
  6. Select "Delete"
  7. Confirm deletion

Verify it's gone

  1. Refresh your FTP file list
  2. .maintenance file should no longer appear
  3. Open your site in browser
  4. Site should load normally (no maintenance message)

If .maintenance file isn't there

Check these locations:

  • WordPress root directory (most common)
  • Public_html folder (if WordPress is in subdirectory)
  • www folder (on some hosting)
  • Root of FTP folder (sometimes ends up here)

If you still can't find it, move to Step 2.


Step 2: Delete .maintenance via SSH Command Line

If you have SSH access, this is instant and certain.

Connect via SSH

  1. Open Terminal (Mac/Linux) or PuTTY (Windows)
  2. Type: ssh username@yoursite.com
  3. Enter password
  4. Navigate to WordPress directory: cd public_html (or wherever WordPress is)

Delete .maintenance file

Run this command:

rm .maintenance

That's it. File is deleted instantly.

Verify it's gone

ls -la | grep maintenance

If no output appears, file is deleted. Site should be back online.


Step 3: Delete .maintenance via File Manager (If No FTP)

Most hosting provides a web-based file manager. Use it if FTP isn't available.

Access hosting control panel file manager

  1. Log into cPanel, Plesk, or hosting control panel
  2. Look for "File Manager" option
  3. Click to open

Navigate to WordPress root

  1. You'll see your directory structure
  2. Find "public_html" or your WordPress folder
  3. Double-click to enter

Show hidden files

  1. Look for "Settings" or gear icon
  2. Check "Show Hidden Files"
  3. Apply

Find and delete .maintenance

  1. Look for ".maintenance" file in the list
  2. Right-click it
  3. Select "Delete"
  4. Confirm

Verify deletion

  1. Refresh file list
  2. .maintenance should be gone
  3. Check your site in browser
  4. Should load normally

Step 4: If .maintenance File Won't Delete

Sometimes the file is locked or has permission issues.

Check file permissions

  1. In FTP, right-click .maintenance file
  2. Select "File Permissions" or "Properties"
  3. Check if it's readable and writable (permissions should be 644)
  4. If permissions are wrong, change to 644
  5. Try deleting again

If still won't delete via FTP

Try via SSH:

chmod 644 .maintenance
rm .maintenance

First command fixes permissions, second deletes file.

If file is still there

Try renaming it instead:

mv .maintenance .maintenance.bak

This renames it so WordPress can't find it. Site should come online.

If nothing works

Overwrite the file with empty content:

echo "" > .maintenance

This empties the file so maintenance message won't appear.


Step 5: Check for Incomplete Update

If .maintenance was deleted but site is still broken, update might be incomplete.

Run database repair

  1. Open wp-config.php via FTP
  2. Add before "That's all, stop editing!":
    define( 'WP_ALLOW_REPAIR', true );
  3. Save and upload
  4. Visit yoursite.com/wp-admin/maint/repair.php
  5. Let WordPress scan and repair database
  6. It will show what was fixed
  7. Remove the WP_ALLOW_REPAIR line after

If database repair shows errors

Database might be corrupted from failed update. Try restoring from backup.


Step 6: Check What Update Was Attempted

Understanding what broke helps prevent it next time.

Check WordPress version

  1. Log into wp-admin
  2. Bottom of Dashboard shows WordPress version
  3. If it's old version, update didn't complete
  4. Try updating again (carefully)

Check WordPress core files

  1. Connect via FTP
  2. Look at wp-includes/ folder
  3. Look at wp-admin/ folder
  4. If files are old dates, core update didn't complete

Check recent plugin/theme updates

  1. Go to Plugins > Installed Plugins
  2. Look for recently updated plugins
  3. Go to Appearance > Themes
  4. Look for recently updated theme

If you find a recently-updated plugin/theme that's broken, deactivate it and try again.


Step 7: Try Updating Again (Carefully)

If update was interrupted, retry it with precautions.

Increase PHP limits before updating

  1. Open wp-config.php
  2. Add before "That's all, stop editing!":
    define( 'WP_MEMORY_LIMIT', '512M' );
    define( 'WP_MAX_MEMORY_LIMIT', '1024M' );
    @ini_set( 'max_execution_time', '600' );
  3. Save and upload

Disable plugins that might conflict

  1. Go to Plugins > Installed Plugins
  2. Deactivate all plugins except essential ones
  3. Try update
  4. If successful, reactivate plugins one by one

Update during low-traffic time

  1. Don't update during peak hours
  2. Do it early morning or late night
  3. When fewer people are on your site

Perform update

  1. Go to Dashboard > Updates (for WordPress)
  2. Or Plugins/Themes > your plugin/theme > Update
  3. Click Update Now
  4. Wait patiently. Do not refresh. Do not close browser.
  5. Completion message should appear
  6. If it hangs again, abort and return to Step 1

Step 8: Enable Debug Logging to See What Failed

If .maintenance deletion helped but site is still broken, debug logs show why.

Enable debug mode

  1. Open wp-config.php
  2. Add before "That's all, stop editing!":
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    define( 'WP_DEBUG_LOG', true );
  3. Save and upload

Load your site to trigger errors

  1. Visit yoursite.com
  2. This triggers any errors
  3. Errors are logged to wp-content/debug.log

Check debug log

  1. Download debug.log from wp-content/ via FTP
  2. Open in text editor
  3. Look for lines with "error", "fatal", "warning"
  4. Search for "update" to find update-related errors

Common update failure errors

Error Cause Fix
"Could not create directory" No write permissions Fix file permissions to 755/644
"Disk quota exceeded" No disk space left Free up disk space or upgrade hosting
"Connect timed out" Download server unreachable Try update again later
"Allowed memory exhausted" PHP memory too low Increase WP_MEMORY_LIMIT to 512M
"Fatal error in update" Plugin conflicted with update Deactivate plugins and retry

Step 9: Restore from Backup if Still Broken

If site is still broken after .maintenance deletion, database might be corrupted from failed update.

Restore from pre-update backup

  1. If you have backup from before update, restore it
  2. Go to Tools > your backup plugin (UpdraftPlus, etc.)
  3. Click "Restore" next to pre-update backup
  4. Select database and files to restore
  5. Wait for restore to complete
  6. Site should work again

If no backup available

  1. Contact hosting provider
  2. Ask if they have automatic backups available
  3. Most hosts keep 7-30 days of automatic backups
  4. They can restore from a point before the update

After restoring

  1. Increase PHP memory limits
  2. Disable problematic plugins
  3. Retry update carefully

Step 10: Prevent Maintenance Mode Hangs

After fixing, prevent this from happening again.

Increase PHP limits

Updates need memory and time. Add to wp-config.php permanently:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
@ini_set( 'max_execution_time', '300' );

Disable plugins during updates

Some plugins interfere with updates. Deactivate all non-essential plugins before updating.

Update during off-hours

Update when traffic is low (early morning, late night). Fewer requests = faster update.

Check disk space

Updates need space for temporary files. Keep at least 500MB free.

Use staging for testing

Test updates on staging site first. Only update production after confirming staging works.

Set up automatic backups

Install UpdraftPlus or similar. Automatic daily backups mean you can always restore if update fails.


Real-World Maintenance Mode Stuck Story

Scenario: An e-commerce site had a WordPress update available. The owner clicked "Update Now" in the admin dashboard. After 2 minutes, the page stopped responding. The owner refreshed and got the maintenance message. They waited 30 minutes and checked againβ€”still in maintenance mode.

What happened:

  1. WordPress core update started
  2. Downloaded new files
  3. Created .maintenance file
  4. Started database updates
  5. A customer hit the site at exactly that moment
  6. The customer's request to the database caused a lock
  7. Update process hung waiting for lock to release
  8. After timeout, process was killed
  9. .maintenance file was never deleted
  10. Site appeared to be updating forever

What we did:

  1. Connected via FTP
  2. Located .maintenance file in WordPress root
  3. Deleted it
  4. Site came back online immediately
  5. Increased PHP memory limit to prevent future issues
  6. Retried update during off-hours (3 AM) when no customers active
  7. Update completed successfully

Total downtime: 1.5 hours (it should have been 5 minutes)

The lesson: Don't wait. Delete .maintenance immediately. The file is your emergency button.


Maintenance Mode Stuck Troubleshooting Checklist

Site stuck in maintenance mode?

  • βœ“ Connect via FTP and find .maintenance file in WordPress root
  • βœ“ Delete .maintenance file
  • βœ“ Refresh your site in browser (should load normally)
  • βœ“ If file not found, check alternative locations (public_html, www, etc.)
  • βœ“ If can't find via FTP, use SSH: rm .maintenance
  • βœ“ If no SSH/FTP, use hosting file manager
  • βœ“ If file won't delete, check permissions (chmod 644)
  • βœ“ If still stuck, run WordPress repair tool: wp-admin/maint/repair.php
  • βœ“ Check WordPress version to see if update completed
  • βœ“ Enable debug logging to see what failed
  • βœ“ Look for incomplete plugin/theme update
  • βœ“ Increase PHP memory limit before retrying update
  • βœ“ Disable plugins before retrying update
  • βœ“ Retry update during low-traffic hours
  • βœ“ If site still broken, restore from pre-update backup
  • βœ“ Contact hosting if can't access FTP/file manager

When to Contact Hosting Support

Contact them if:

  • You can't access FTP or SSH to delete file
  • File manager isn't available in control panel
  • .maintenance file exists but won't delete (permission issue)
  • Site is still down after deleting .maintenance
  • You need help restoring automatic backups
  • Database is corrupted from failed update
  • You've tried all steps and still stuck

What to tell them:

"WordPress is stuck in maintenance mode. There's a .maintenance file in my root directory that I can't delete. Can you help me remove it or restore from backup?"

Most hosting fixes this in 15-30 minutes.


The Real Talk

Seeing "Briefly unavailable for scheduled maintenance" is one of the most stressful WordPress messages. You immediately think your site is broken, permanently.

But here's what you need to know: It's fixable in seconds.

That .maintenance file is just a text file. Deleting it brings your site back instantly. It doesn't fix the underlying update issue, but it gets your site online so customers can use it while you troubleshoot.

Delete the file. Site comes back. Then diagnose what went wrong with the update.

That's the strategy. Don't let your site sit in maintenance mode for hours wondering what to do. Delete .maintenance. Get back online. Investigate later.

And then, set up automatic backups and increase PHP limits so this doesn't happen again.

Maintenance mode stuck is scary for 30 seconds. Then it's solved.