WordPress stuck in maintenance mode is one of the most common — and most alarming — issues site owners encounter, often appearing right after a plugin or core update. One moment your site is running normally, and the next your visitors see a plain message reading "Briefly unavailable for scheduled maintenance. Check back in a minute." This guide walks you through every reliable method to diagnose and fix the problem, whether you are a complete beginner or an experienced developer.
What Causes WordPress to Get Stuck in Maintenance Mode?
Understanding why the issue happens makes it far easier to prevent in the future. WordPress enters maintenance mode automatically whenever it runs an update — whether that is a core update, a plugin update, or a theme update. During this process, WordPress creates a temporary file that tells the server to display the maintenance message to all visitors.
The .maintenance File Explained
When WordPress begins an update, it writes a hidden file called .maintenance to the root directory of your WordPress installation. This file contains a single PHP timestamp. As long as this file exists, WordPress serves the maintenance page to every visitor. Under normal circumstances, WordPress deletes the file automatically once the update completes successfully.
Common Triggers for Getting Stuck
- The browser tab was closed mid-update
- A PHP timeout occurred during a large plugin update
- A server error (500 or 503) interrupted the update process
- Insufficient file permissions prevented WordPress from deleting the file
- A conflict between plugins caused the update script to crash
- Low PHP memory limit halted execution before cleanup
Method 1: Delete the .maintenance File via FTP
The most universal fix is to manually delete the .maintenance file. Because it is a hidden file, you need to make sure your FTP client or file manager is set to show hidden files before you start.
Step-by-Step via FTP (FileZilla)
- Open FileZilla (or your preferred FTP client) and connect to your server using your FTP credentials.
- In FileZilla, click Server in the top menu, then select Force showing hidden files.
- Navigate to the root directory of your WordPress installation — this is typically
public_htmlorwww. - Look for a file named .maintenance in the file list on the right-hand panel.
- Right-click the .maintenance file and select Delete.
- Confirm the deletion when prompted.
- Refresh your WordPress site in the browser to confirm maintenance mode is gone.
Step-by-Step via cPanel File Manager
- Log in to your hosting control panel and open File Manager.
- Navigate to your WordPress root directory (usually
public_html). - Click Settings in the top-right corner of File Manager.
- Check the box labelled Show Hidden Files (dotfiles) and click Save.
- Locate the .maintenance file in the directory listing.
- Right-click it and choose Delete, then confirm.
- Visit your website to verify it is back online.
Method 2: Fix WordPress Maintenance Mode Using WP-CLI
If you have command-line access to your server, WP-CLI is the fastest and most reliable way to resolve this issue. It is also the method preferred by developers and system administrators managing multiple WordPress installations.
Using WP-CLI to Remove the Maintenance File
- Open your terminal or SSH into your server.
- Navigate to your WordPress root directory.
- Run the following command to confirm WordPress is in maintenance mode and locate the file:
# Check if the .maintenance file exists
ls -la | grep .maintenance
# Remove the .maintenance file directly
rm .maintenance
# Verify WordPress is accessible again
wp core is-installed --allow-root
Deactivating a Problematic Plugin via WP-CLI
If maintenance mode keeps returning, a plugin may be repeatedly crashing during its update. You can deactivate all plugins at once from the command line:
# Deactivate all plugins to prevent update loops
wp plugin deactivate --all --allow-root
# Then reactivate them one by one to find the culprit
wp plugin activate plugin-folder-name --allow-root
Method 3: Fix via wp-config.php or PHP Configuration
In some edge cases — particularly on managed hosting environments where file access is restricted — you may need to approach the fix through your WordPress configuration. This section also covers how to prevent future occurrences by adjusting PHP settings.
Increasing PHP Memory Limit in wp-config.php
A low memory limit is a frequent cause of interrupted updates. Adding the following line to your wp-config.php file can prevent the issue from recurring:
// Add this line BEFORE the "That's all, stop editing!" comment
define( 'WP_MEMORY_LIMIT', '256M' );
// Also increase the max memory limit for admin operations
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
- Connect to your server via FTP or File Manager.
- Navigate to the root of your WordPress installation.
- Download a backup copy of wp-config.php before editing.
- Open wp-config.php in a text editor.
- Add the memory limit definitions shown above before the line that reads
/* That's all, stop editing! Happy publishing. */. - Save the file and re-upload it to your server.
- Attempt the failed update again from your WordPress dashboard.
Increasing PHP Execution Time
If large plugin or theme updates time out before completing, the update process gets abandoned mid-stream and the .maintenance file is never cleaned up. You can address this by adding the following to your wp-config.php:
// Extend PHP execution time to allow large updates to complete
@ini_set( 'max_execution_time', 300 );
Method 4: Disable Maintenance Mode Programmatically
For developers who want a more robust, reusable solution, WordPress provides hooks and filters that give you fine-grained control over maintenance mode behaviour. This is particularly useful if you manage client sites and want a reliable safety net built into your theme or a custom plugin.
Using a Must-Use Plugin to Disable Maintenance Mode
- Connect to your server via FTP or File Manager.
- Navigate to
wp-content/mu-plugins/. If this folder does not exist, create it. - Create a new PHP file — for example,
disable-maintenance.php. - Add the following code to the file:
<?php
/**
* Plugin Name: Disable Maintenance Mode
* Description: Removes maintenance mode if it gets stuck.
*/
add_filter( 'enable_maintenance_mode', '__return_false' );
- Save the file and upload it to the
mu-pluginsdirectory. - Refresh your site — the filter will prevent WordPress from serving the maintenance page.
- Once your site is back online, you can delete this file or keep it as a permanent safeguard.
Understanding the enable_maintenance_mode Filter
The enable_maintenance_mode filter was introduced in WordPress 3.6. When it returns false, WordPress skips the maintenance check entirely. Note that this filter is loaded very early, which is why placing it in a must-use plugin (which loads before regular plugins) guarantees it fires in time to prevent the maintenance page from displaying.
How to Prevent WordPress Getting Stuck in Maintenance Mode Again
Fixing the immediate problem is only half the battle. Implementing a few best practices will significantly reduce the likelihood of it happening again on your site.
Best Practices Before Running Updates
- Back up your site first: Always create a full backup (files and database) before running any updates. Tools like UpdraftPlus or Jetpack Backup make this straightforward.
- Update one item at a time: Avoid selecting all plugins and running a bulk update simultaneously. Update them individually so you can identify which one causes a problem.
- Test in a staging environment: Run updates on a staging site before applying them to production.
- Check server resources: Make sure your hosting plan has adequate PHP memory and execution time limits before running major updates.
- Avoid updating during peak traffic hours: Server load during updates increases the risk of timeouts.
Monitoring and Uptime Alerts
Set up uptime monitoring using a service such as UptimeRobot or Pingdom. These tools will alert you by email or SMS within minutes if your site goes offline, including when it gets stuck in maintenance mode. Early notification dramatically reduces visitor impact.
Keeping PHP Version Updated
Running an outdated PHP version is a common contributor to update failures. PHP 7.4 and earlier have reached end-of-life and exhibit performance and stability issues with modern WordPress plugins. Upgrade to PHP 8.1 or 8.2 through your hosting control panel for improved reliability during update processes.
Frequently Asked Questions
How long should WordPress maintenance mode last?
Under normal circumstances, WordPress maintenance mode should last only a few seconds to a few minutes, depending on the size of the update. If your site has been showing the maintenance message for more than five minutes, it is almost certainly stuck and you should follow the steps in this guide to delete the .maintenance file manually.
Will deleting the .maintenance file break my WordPress site?
No. Deleting the .maintenance file simply tells WordPress to stop displaying the maintenance page. If the underlying update did not complete successfully, you may need to re-run it from the WordPress dashboard, but deleting the file itself causes no damage to your database or core files.
Why does my WordPress site keep going into maintenance mode repeatedly?
If maintenance mode returns repeatedly, the most likely causes are a plugin that fails to update cleanly (often due to a PHP error or memory limit), an automated update task running on a schedule, or a caching plugin that is serving a cached version of the maintenance page even after the .maintenance file has been deleted. Clear all caches after resolving the issue and investigate which plugin is triggering the update loop.
Can I put WordPress into maintenance mode intentionally for site work?
Yes. You can use a dedicated maintenance mode plugin such as WP Maintenance Mode or Coming Soon Page to display a professional, branded maintenance page to visitors while you work on the site. These plugins give you full control over when maintenance mode is active and inactive, unlike the automatic .maintenance file created during updates.
Fixing WordPress stuck in maintenance mode is straightforward once you know where to look, but it can feel stressful when your site is down and visitors are seeing an error. The methods above cover every scenario — from a quick file deletion through FTP to advanced WP-CLI commands and PHP configuration tweaks. For an even faster resolution next time, consider using WP AI Agent, an AI-powered tool that lets you manage, troubleshoot, and fix WordPress tasks like this through simple natural-language chat — no manual file access required.