When you update a plugin, theme, or your WordPress installation, WordPress temporarily triggers maintenance mode. During this period, your visitors will see the following message until the update is complete: “Briefly unavailable for scheduled maintenance. Check back in a minute”
How maintenance mode works
During the update process, WordPress pauses some backend processes briefly, often just for a few seconds, depending on the size and number of updates. WordPress uses the wp_maintenance() function to create a temporary .maintenance file on your site. This file contains the maintenance alert message. Once the updates are completed, the file is automatically removed, and your site returns to normal.
How to manually enable and disable maintenance mode
There are two primary ways of enabling maintenance mode manually:
Using a plugin
This is a recommended method of enabling Maintenance mode, as it’s easy and allows you to customize the maintenance page your front-end visitors will see. Based on reviews and active plugin installations, we recommend Maintenance by WebFactory as one of the most popular and user-friendly maintenance plugins.
Note:
If you are using Elementor plugin, you can use its built-in maintenance mode feature. Here is how.
Follow the usual routine to install it
- Open WordPress admin, go to Plugins, click Add New.
- Enter “maintenance” in search and hit Enter.
- Locate the Maintenance plugin and click Install Now and then Activate.
Note:
You can also install plugins from your 10Web dashboard. Here is how.
- Maintenance mode will be enabled automatically upon the plugin activation.
- To customize and edit the newly enabled maintenance page, please find the Maintenance menu on the left-hand menu of your WordPress dashboard.
- Once you are done with the edits, you can preview your changes and, eventually, Save them.
- To disable maintenance mode, locate the green button in the center of the Maintenance plugin menu and switch it off.
Using code
Add this snippet to your functions.php file:
function enable_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Maintenance Mode</h1><p>We are updating our website, please check back soon.</p>', 'Maintenance Mode');
}
}
add_action('get_header', 'enable_maintenance_mode');
Via SSH
There are several WP-CLI commands that allow you to enable, disable and check the maintenance mode status while connected to your site via SSH:
# Activate Maintenance mode.
$ wp maintenance-mode activate
# Deactivate Maintenance mode.
$ wp maintenance-mode deactivate
# Display Maintenance mode status.
$ wp maintenance-mode status
Why your site might get stuck in maintenance mode
Occasionally, WordPress can get stuck in maintenance mode. This happens when there is a conflict, causing the .maintenance file to think that some operations are still pending. As a result, the file doesn't remove itself, and the maintenance message persists. Fortunately, this issue is easy to prevent and fix.
How to ensure your site doesn’t get stuck in maintenance mode
To avoid getting stuck in maintenance mode, follow these tips:
- Don’t refresh or navigate away during an update: Stay on the update screen until the process finishes.
- Avoid updating multiple plugins at once: Updating plugins one by one minimizes potential conflicts.
- Update your plugins immediately: Ensure that plugins are always running their latest version to reduce the chances of conflicts.
- Consider setting plugins to auto-update: This ensures that updates happen in the background without manual intervention.
How to fix a stuck maintenance mode
If your site does get stuck in maintenance mode, the solution is simple: delete the .maintenance file. Here’s how you can do it:
-
Connect via SFTP or SSH.
- If you are unfamiliar with this, here is how to connect.
- Navigate to the wp-live/ folder of your site.
- This is the folder that contains your wp-config.php file.
- Locate and delete the .maintenance file.
Once deleted, your site will exit maintenance mode and function normally.
How to customize the maintenance mode notice
The default maintenance message—“Briefly unavailable for scheduled maintenance. Check back in a minute.”—is functional but basic. If you want the Maintenance Mode page to align with your site's branding, it is best to go with the plugin option explained above.