WordPress Maintenance Mode – Troubleshooting and Customizing
- Category : WordPress
- Posted on : Oct 11, 2018
- Views : 3,239
- By : Hagen V.

The WordPress maintenance mode page is something that is automatically shown to visitors temporarily when you make updates on your site, such as updating plugins, themes, or core. This is to keep from anything appearing broken or out of sync while files are being patched. However, there are a couple issues with this. The first is that sometimes your WordPress site might get stuck in maintenance mode. This essentially takes down your whole site until you manually fix it. The second is that the default maintenance page/message isn’t styled, looks rather ugly, and is limited in its messaging to your visitors and customers. This might not be the best for your branding or reputation. Today we’ll explore some ways to resolve these issues.
- WordPress Maintenance Mode
- WordPress Site Stuck in Maintenance Mode?
- Extending Your WordPress Maintenance Mode
WordPress Maintenance Mode
The WordPress maintenance mode is a great little feature that is built into core and was introduced in version 3.0. Whenever you update a plugin, theme, or your WordPress installation, the following message is shown to your visitors until the update operations have completed.

During the update and installation process, some backend processes are stopped for a short period of time (usually only for a few seconds depending upon the number and size of updates). WordPress utilizes the wp_maintenance() function and creates a temporary .maintenance file on your site which contains the alert you see above. After the updates have completed, the file is automatically removed and your site goes back to normal.
By default, WordPress returns a 503 HTTP status code (service unavailable.) when in maintenance mode. This basically tells Google your working on the page or something went wrong and they will check back later. This is the header response you want to show for SEO, as it won’t harm your rankings if your site is temporarily down. Yoast has a great article on the importance of the 503 HTTP header in regards to SEO.
Is Your WordPress Site Stuck in Maintenance Mode?
A common issue that WordPress users run into is that their site might get stuck in maintenance mode. This can be very frightening as this also can also affect the administrator and backend. Suddenly you can’t login to your WordPress site and your website is essentially down, except for the brief message that visitors see.
This commonly happens when there is a conflict, in which case the .maintenance file might think there are still pending operations and or updates needing to finish. This results in the file remaining and never removing itself. What causes the conflict? In our experience, we have seen this happen if the user manually clicks “update now” on a number of different plugins at a very rapid pace. WordPress by default staggers updates in order, but if there is even a ms of a delay in the connection, this could result in a sudden conflict, triggering the stuck maintenance mode.
To ensure this doesn’t happen, you can easily click on the filter “Update Available,” and then select “Update” from the bulk actions dropdown. Then click “Apply.” This will then fire off the updates in order and you are less likely to receive a conflict.

Another recommendation to prevent this from happening is to update your plugins as they are patched. Don’t wait 6 months and then try to update them all at once. If you have 30+ plugins needing multiple updates, it is probably better to update them one by one, and test, as you go to ensure nothing breaks on your site. This is one of the reasons why Host SEO has free staging environments so that you can test everything on a clone of your live site beforehand, and minimize the risk of breaking your production site.
How to Quickly Get Out of Maintenance Mode
Thankfully, if your WordPress site is currently stuck in maintenance mode, it is very easy to get back out and return your site to normal. You simply need to delete the .maintenance file that was created.
Step 1
The first step is to login to your site via FTP. Check out our in-depth post on how to SFTP into your WordPress site.
Step 2
Navigate to the root of your WordPress site and or public HTML folder. This is the same folder that normally contains your wp-config.php file. You can then delete the .maintenance file.

After it has been deleted you can refresh your website in your browser and your site should be back to normal. It is also recommended that you clear the cache on your WordPress site.
Extending Your WordPress Maintenance Mode
There are quite a few ways you can extend your WordPress maintenance mode, such as enabling it manually and or customizing the screen so that it more closely matches your branding. You can also add more messaging to your visitors and or customers so they stay in the loop. Remember, that the more traffic you get on your site, the more important the maintenance mode messaging and styling as more people will be more likely to see it.
Another reason why you might want an improved maintenance mode page, besides running updates, is that perhaps you are migrating changes over to production manually. We always recommend testing on a development site first, but there are times when you might need to throw up a maintenance page on your production site for an hour or two.
Manually Enabling WordPress Maintenance Mode With Code
You can enable the WordPress maintenance mode manually with code by placing the following in your functions.php file. Or better yet, do it with a WordPress child theme.
// Activate WordPress Maintenance Mode
function wp_maintenance_mode(){
if(!current_user_can('edit_themes') || !is_user_logged_in()){
wp_die('<h1 style="color:red">Website under Maintenance</h1><br />We are performing scheduled maintenance. We will be back on-line shortly!');
}
}
add_action('get_header', 'wp_maintenance_mode');This will result in a