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 of 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.
Check Out Our Video Guide On WordPress Maintenance Mode:
What Is 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.
“Briefly unavailable for scheduled maintenance. Check back in a minute.”
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 you’re 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 log in to your WordPress site and your website is essentially down, except for the brief message that visitors see.
How to Avoid Getting Stuck in Maintenance Mode
Getting stuck in maintenance mode 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.
Don’t Refresh or Navigate Away From the Screen During an Update
One of the most common causes of a site getting stuck in maintenance mode is when the updates screen is refreshed or left during an update.
The easiest way to avoid this is to resist the temptation to do anything while the update is taking place. Make sure you wait until all updates are complete before refreshing or navigating away from the screen – and scroll down to check that plugins further down the screen have been updated.
Don’t Update Multiple Plugins at Once
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 millisecond 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.
Update Your Plugins as They’re Patched
Another recommendation to prevent this from happening is to update your plugins as they are patched. Don’t wait six 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 Kinsta 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.
Automatically Update Plugins
If you don’t have time to regularly update your plugins, or you think you’ll forget, you can use a plugin to automatically update them, or adjust your WordPress settings to do this.
See our guide to WordPress automatic updates to find out how to configure this.
How to Fix WordPress Site Stuck in 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.
If you are a Kinsta customer you can clear the cache right from within the MyKinsta dashboard or the admin toolbar of your WordPress dashboard (if you have access). And you can always reach out to your hosting provider for support if you have trouble following the above steps.
The Quickest Way to Fix your WordPress site Stuck in Maintenance Mode
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. 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 Extending WordPress Maintenance Mode With Code
The default maintenance screen isn’t customizable (it is also dynamically generated) and so you might want to style it to match the branding and appearance of your website. Here’s a nice little tip to create a custom page.
All you need to do is create a file, call it maintenance.php, and drop it in your /wp-content/ folder. You can then style it with CSS or even create an entire page from scratch.
This way when you update WordPress core, themes, or plugins it will use the new file with your customizations instead. The check for this file is already defined in the load.php file located in /wp-includes/ so you don’t have to do anything extra. It looks like this:
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
require_once( WP_CONTENT_DIR . '/maintenance.php' );
die();
}
Utilizing a WordPress Maintenance Mode Plugin
If you aren’t comfortable with editing code or need something more, you can also take your WordPress maintenance mode to the next level by utilizing some free and premium plugins
Coming Soon Page, Maintenance Mode & Landing Pages by SeedProd
The Coming Soon Page & Maintenance Mode plugin is developed by John Turner over at SeedProd and was launched way back in 2011. It has a great reputation in the WordPress community for being a well-supported plugin for both coming soon pages and maintenance mode.
A lot of this has to do with the fact that there is a free and premium version. Sometimes having two versions ensures you get more updates.
It currently has over 1 million active installs with an impressive 5 out of 5-star rating. You can download Coming Soon Page & Maintenance Mode from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. Some of its additional features include:
- Works with any WordPress theme and is responsive
Customize the look and feel
- Easily add CSS and HTML
- Multisite and BuddyPress Support
- Create landing and coming soon pages and collect email addresses
WP Maintenance Mode
WP Maintenance Mode is one of the highest downloaded plugins when it comes to throwing up a quick and easy maintenance mode message for your WordPress site. It is completely free and created by the team over at Designmodo, a popular web design blog.
Only users with enough rights can see the frontend, otherwise, everyone else will see the maintenance mode message when enabled. It works with WordPress Multisite, however, it is important to note that it can be unstable with caching plugins.
It currently has over 700,000 active installs with a 4.5 out of 5-star rating. You can download WP Maintenance Mode from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. Some of its additional features include:
- Ability to change colors, text, and backgrounds
- Subscription form, contact form, and timer
- Included landing page templates
- Works with any WordPress theme
- SEO options for 503 HTTP header response
- You can exclude URLs from maintenance, this is especially handy if you have changed your WordPress login URL
CMP – Coming Soon & Maintenance
The CMP – Coming Soon & Maintenance plugin has over 100,000 downloads and a five-star average rating. It’s not been translated into English but will work on an English-speaking site as it’s the backend that isn’t in English, not the maintenance screen itself.
For a free plugin, it has an impressive list of features, designed to let you create a customised maintenance page without having to pay for a premium plugin.
Features include:
- Three bundled themes plus extra premium themes you can download
- Access to stock photos
- Custom subscribe form to collect email addresses
- Google fonts integration
- Upload your logo or a background image
- Preview URL you can share with clients
- Redirection to an alternative website
- Ability to set search engine response codes
- Google analytics support
Slim Maintenance Mode
The Slim Maintenance Mode plugin does exactly what you would think. This essentially creates the same type of page as we showed you how to implement above with code. Just activate the plugin and only administrators can see the website. If you want something that is free, fast, and lightweight, definitely check this one out.
It has no extra settings and nothing for you to do except turn it on – at which point your site will be visible only to administrators. The downside is that you can’t customize the message.
It currently has over 1000 active installs with a 5 out of 5-star rating. In fact, as of writing this, it doesn’t have a single bad review! And that is because it just works. You can download Slim Maintenance Mode from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins. Some of its additional features include:
- Small, simple, lightweight
- No extra settings to worry about, just activate and your good to go
- Works with any WordPress theme
- Backend message as a reminder that you know it is active
- 503 HTTP header response
- Well supported with popular caching plugins
WP Maintenance
The WP Maintenance plugin has over 30,000 installations, with a 4.5-star average rating. It’s not been translated into English yet but will still work just fine on an English-language site, as any text seen by users is input by you.
The plugin includes customization and personalization options such as:
- Choice of colors and fonts for your maintenance page
- Logo or image upload, plus the option to add a slider
- Countdown timer
- Link to social media and google analytics
- Edit access by user role
Minimal Coming Soon & Maintenance Mode
The Minimal Coming Soon & Maintenance Mode for WordPress plugin is developed by the team over at Web Factory, who also runs the popular blog WP Loop. They currently maintain 5+ plugins on the repository and are not newcomers in regards to creating needed solutions for WordPress.
It currently has over 90,000 installs with just under a 5 out of 5-star rating. You can download Minimal Coming Soon & Maintenance Mode for WordPress from the WordPress repository or by searching for it within your WordPress dashboard under “Add New” plugins.
The plugin is regularly updated.
Some of its additional features include:
- Works with all WordPress themes and plugins
- Ability to change every single element you see, including the background color, cover images, fonts, etc.
- Preview the maintenance page before activating
- Decent caching plugin support
- Works with custom login URLs
- Visible to only non-logged in users
- Google Analytics support
- Google fonts
Utilizing the WPBuffs Maintenance Service
If you don’t want the hassle of managing maintenance mode yourself, you could always hire a WordPress maintenance company, such as WP Buffs, which will handle things like this for you.
WPBuffs will keep your site up to date and make sure updates are happening when your site is at its least busy – and they’ll make sure your site doesn’t get stuck in maintenance mode when it’s being updated.
How to Redirect from WordPress Maintenance Mode Screen
If you want to redirect to a custom maintenance screen instead of using maintenance.php, the best option is to use a plugin.
The maintenance plugins below will provide an alternative maintenance page which you can manually activate if you’re working on your site and which will also be activated when WordPress is running updates.
This way, instead of seeing the dull default screen, users will see a more professional maintenance screen which you can brand and customize using the plugin interface.
How to Customize Your Maintenance Mode Screen in WordPress
How to Enable and Disable WordPress Maintenance Mode
Sometimes you might want to manually enable maintenance mode in WordPress when you’re working on your site but not necessarily running theme and plugin updates. In this scenario, WordPress won’t automatically trigger maintenance mode so you need to do it manually.
There are two ways to do it: with code, and with a plugin.
How to Manually Enable 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 your own plugin.
// 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 message being placed on the front of your website to users who are not logged in. Administrators can still access the dashboard as it is utilizing the built-in is_user_logged_in() function.
If you want, you can create something more complex – but remember that as you aren’t accessing your theme’s stylesheet, any styling you add will have to be added inline with your code.
How to Manually Enable WordPressMaintenance Mode with a Plugin
You can also enable maintenance mode with the plugins we’ve listed above. For example:
- With Coming Soon & Maintenance Mode by Seedprod, you can turn maintenance mode on and off and customize the maintenance screen, as well as creating ‘coming soon’ or landing pages to let people know when the site will be up and running and collect their email address.
- With WP Maintenance Mode, you can manually activate a custom maintenance screen for users other than the admin.
- With CMP – Coming Soon & Maintenance, you can create a fully custom maintenance screen using their themes and manually activate it when you need to.
- With Slim Maintenance Mode, simply activate the plugin to manually activate a stripped-down maintenance screen.
- With WP Maintenance, you can create a maintenance page with a countdown timer and custom fonts and colors, and manually activate it via the plugin interface.
- With Minimal Coming Soon & Maintenance Mode, you can create a fully custom maintenance mode page, link it to your analytics software, and manually enable it.
All of these plugins let you manually turn maintenance mode on and make your site private. The difference between them lies in how easy they make this to do and how much you can customize the maintenance screen.
When to Use WordPress Maintenance Mode
So, when should you use maintenance mode?
These are the times you’re most likely to need it:
- When you’re running updates to plugins, themes, or WordPress itself.
- When you’re uploading a new version of your theme or plugins.
- When you’re working on the code in your site (although you shouldn’t edit the live site’s code: use a development or staging site instead and then copy your changes to the live site).
- When you’re making edits to the content you don’t want people to see.
- When you’re making structural changes to the site e.g. changing the navigation or moving pages around.
- When your site is in development, before it’s launched, you might use maintenance mode. You might use a plugin to create a coming soon page, which will be more useful and better for SEO.
So maintenance mode is useful not just when you’re running an update, which is why it’s helpful to be able to manually activate it.
Summary
As you can see, the WordPress maintenance mode included in core is great. However, it can easily be extended and customized to match your branding.
You also might want to customize the messaging so that visitors and customers know exactly why your website is down. And if you ever get stuck in maintenance mode, you now know how to quickly recover and get your site back online. Make sure to read our in-depth guide on WordPress maintenance to keep your site in better shape.
Do you have any other tips in regards to the WordPress maintenance mode?
The customization and tut on adding a maintenance.php file is outdated and does not work. Maybe it only works on Kinsta?