How to Fix WordPress Stuck in Maintenance Mode
Your WordPress site is showing a maintenance mode screen, and it will not go away no matter how many times you refresh the page. Every minute that passes means lost traffic, lost revenue, and a frustrated audience who cannot access your content. The most common cause is an incomplete update that left a specific file behind, and the quickest fix takes less than thirty seconds using FTP or a file manager.
Before you start any of the solutions below, back up your entire site — including files and database — and create a restore point. Most fixes are low-risk, but a single typo in a core file can break your site further. Use a plugin like UpdraftPlus or your hosting control panel to make a full backup first.
Why does WordPress get stuck in maintenance mode?
WordPress enters maintenance mode automatically whenever it runs an update for core, a theme, or a plugin. The system creates a temporary file named .maintenance in the root directory. When the update finishes successfully, WordPress deletes that file. If the update is interrupted — by a timeout, a server error, or a browser close — the file stays behind and the site remains locked.
Other causes include plugin conflicts, memory limit exhaustion, corrupted plugin files, and theme issues. A stuck maintenance mode screen can also happen if a caching plugin holds a stale version of the page.
- Incomplete core, theme, or plugin update
- Server timeout during an update
- Plugin or theme conflict
- Low PHP memory limit
- Corrupted
.maintenancefile - Stale cache from a caching plugin
- File permission issues on the server
- Conflict with a security plugin or firewall
Before you begin: what you need to have ready
You need access to your site's files, either via FTP (FileZilla or similar) or through your hosting control panel's file manager. You also need access to your WordPress admin dashboard (if you can reach it via a direct URL) and your database management tool (phpMyAdmin is the most common). Write down your database credentials from the wp-config.php file before you make any edits.
Fix 1: Delete the .maintenance file (quickest method)
Connect to your site using FTP or open your hosting file manager. Navigate to the root directory where you installed WordPress — this is the same folder that contains wp-config.php, wp-content, and wp-admin folders. Look for a file named .maintenance. If you see it, delete it. That is it.
// Example path to the .maintenance file
/publichtml/.maintenanceAfter deleting the file, refresh your site. It should load normally. If the file reappears later, a plugin or theme is still trying to update. Proceed to the next fixes to address the underlying cause.
Fix 2: Clear your browser and site cache
Sometimes the maintenance screen is a cached version served by a plugin or a content delivery network. Clear your browser cache and any server-side cache your hosting provider offers. If you use a caching plugin like W3 Total Cache or WP Super Cache, access your site via a direct URL that bypasses the cache (for example, add ?nocache=1 to the end of your site URL).
If you can reach the WordPress admin dashboard, go to Settings > Permalinks and click Save Changes to flush rewrite rules. Then go to any caching plugin settings page and clear all cache. Refresh your site again.
Fix 3: Increase the PHP memory limit
A low PHP memory limit can cause updates to fail and leave the .maintenance file behind. Edit your wp-config.php file and add the following line before the / That's all, stop editing! / comment:
define('WPMEMORYLIMIT', '256M');Save the file and refresh your site. If your hosting provider restricts this constant, you may need to increase the limit via the hosting control panel or by editing the php.ini file. Contact your host's support if the change does not take effect.
Fix 4: Manually complete the update via FTP
If a core update failed, manually upload the latest WordPress core files. Download the latest WordPress version from wordpress.org and unzip it on your computer. Using FTP, upload the wp-admin and wp-includes folders (and the root files like wp-login.php) to your server, overwriting the existing files. Do not overwrite wp-config.php or the wp-content folder — that would break your site.
After uploading, delete the .maintenance file if it still exists. Navigate to Dashboard > Updates and click the button to reinstall WordPress. This forces a clean update and removes the maintenance lock.
Fix 5: Rename the active theme and plugins via FTP
A faulty plugin or theme can cause an update to hang. Rename the wp-content/plugins folder to wp-content/pluginsold using FTP. This disables all plugins at once. Refresh your site. If the maintenance screen disappears, a plugin is the culprit. To identify which one, rename the folder back and then rename individual plugin folders one by one until the problem returns.
If the issue persists after disabling plugins, rename the wp-content/themes folder to wp-content/themesold. WordPress will fall back to the default theme (Twenty Twenty-Four or similar). If the site loads, your theme caused the issue. Reinstall or update the theme.
Fix 6: Check file and folder permissions
Incorrect file permissions can prevent WordPress from deleting the .maintenance file after an update. Using FTP, check that folders are set to 755 and files are set to 644. The wp-config.php file should be 600 or 640 for security. Right-click the root folder and adjust permissions recursively. Some hosting panels have a dedicated permission fixer tool.
After correcting permissions, delete the .maintenance file and refresh your site. If you see permission errors in your WordPress debug log, fix those paths first.
Fix 7: Clear the database transients
WordPress stores update status information in the database as transients. A corrupted transient can cause the site to think an update is still in progress. Access phpMyAdmin, select your WordPress database, and run the following SQL query:
DELETE FROM wpoptions WHERE optionname LIKE '%transient%';If your table prefix is not wp, adjust the query accordingly (for example, myprefixoptions). After running the query, delete the .maintenance file again and refresh your site.
| Fix Method | Difficulty | Time Required |
|---|---|---|
| Delete .maintenance file | Beginner | 1 minute |
| Clear cache | Beginner | 2 minutes |
| Increase PHP memory limit | Intermediate | 5 minutes |
| Manual core update via FTP | Intermediate | 15 minutes |
| Rename themes/plugins folder | Intermediate | 10 minutes |
| Fix file permissions | Intermediate | 10 minutes |
| Clear database transients | Advanced | 5 minutes |
| Use WP-CLI to clear maintenance mode | Advanced | 2 minutes |
Fix 8: Use WP-CLI to clear maintenance mode
If you have SSH and WP-CLI access to your server, run the following commands. First, check if the maintenance mode is active:
wp maintenance-mode statusIf it shows active, deactivate it with:
wp maintenance-mode deactivateThis removes the .maintenance file and clears related data. WP-CLI is a powerful tool for troubleshooting; you can also check for plugin updates or run a health check from the command line.
Fix 9: Increase the execution timeout
A server timeout during an update can leave your site stuck. Edit your wp-config.php file and add this line:
settimelimit(300);This increases the maximum execution time to 300 seconds. Save the file, delete the .maintenance file, and refresh your site. If the timeout was the root cause, the increased limit should allow future updates to complete.
Fix 10: Disable server-level caching or firewall rules
Some hosting providers or server-level firewalls (like ModSecurity) can interfere with WordPress updates. Contact your hosting support and ask them to temporarily disable ModSecurity or server-level caching. Then try the update again. Once the update completes and the site is back, re-enable the security features.
If you have a CDN (like Cloudflare), pause it temporarily. CDN caching can serve a stale maintenance page even after the .maintenance file is removed. After the fix, purge the CDN cache.
How to prevent your site from getting stuck in maintenance mode
Prevention is straightforward. Always update during low-traffic hours. Ensure your PHP memory limit is at least 256 MB. Keep a recent backup of your site files and database. Use a staging environment to test updates before applying them to the live site. If you run many plugins, update them one at a time rather than in bulk.
Consider using a maintenance mode plugin that gives you more control over the process. Some plugins let you set a custom timeout for maintenance mode, so it automatically removes the lock if an update takes too long. Finally, keep your WordPress installation, themes, and plugins updated — avoiding outdated software reduces the chance of update conflicts.
Frequently asked questions
Why does WordPress get stuck in maintenance mode after a failed update?
A failed update leaves behind the temporary .maintenance file that WordPress creates to lock the site during updates. When the update does not complete — due to a timeout, server error, or user interruption — the file persists and the site remains in maintenance mode.
Can I prevent WordPress from showing maintenance mode during updates?
Yes. You can disable automatic maintenance mode by adding a constant to your wp-config.php file: define('WPAUTOUPDATECORE', false);. However, this also disables automatic core updates entirely. A better approach is to increase the execution timeout and memory limit so updates finish before the server cuts them off.
What should I do if deleting the .maintenance file does not work?
If the site remains stuck after deleting the file, the issue is likely a caching problem (browser, plugin, or server cache) or a plugin conflict. Clear all caches, disable plugins via FTP, and switch to a default theme. A persistent maintenance screen can also indicate corrupted database transients, which you can clear via phpMyAdmin.
Is it safe to run SQL queries on my WordPress database?
Yes, as long as you back up the database first. The query to delete transients is safe and commonly used. Never run a DELETE query on the wpposts or wpusers tables without a backup, and always verify your table prefix.
Can a security plugin cause the maintenance mode screen to stay?
Yes. Some security plugins block access to the .maintenance file or interfere with the update process. Temporarily disable any security plugin via FTP to see if it resolves the issue. If it does, contact the plugin's support for a permanent fix.
Key takeaways
- The most common fix is deleting the
.maintenancefile via FTP or file manager. - Always back up your site and database before attempting any troubleshooting steps.
- Clear browser, plugin, and server caches after removing the maintenance file.
- Increase your PHP memory limit and execution timeout to prevent future failures.
- Test updates on a staging site before applying them to the live environment.