A Quick and Thorough Guide to WordPress Maintenance Mode
As you build or maintain a WordPress website, you’ll likely find moments where you need to make your site inaccessible to the public. This is – rather obviously – referred to as putting your site into “maintenance mode.”
Whether you’re performing simple plugin updates or making full-scale site modifications, maintenance mode is a handy tool to have in your developer’s toolkit. But when should you use it? Are there times when it’s not appropriate? And how can you implement it most effectively?
These are questions I’ll endeavor to answer today in full. So pull up a chair and get settled. Let’s unpack maintenance mode, shall we?
Why Maintenance Mode?
There are several situations where maintenance mode comes in handy.
The first situation is when you are performing website updates which may involve updating themes and plugins, or installing and setting up a new theme. Usually, a new theme means you have to at least set up some basic options to get it to look and function as intended. Maybe it involves custom widget areas. Or perhaps you want to customize the colors and the fonts or build custom page layouts.
Whatever the case may be, you certainly don’t want your visitors confused as they browse posts and pages and see a different look each time. In such situations, enabling maintenance mode lets them know you are working on your site and they can check back later once you have everything set up the way you want.
Leading Up to a Live Launch
The second situation is when you are building your site on a live domain and you don’t want your visitors to see it until you’re ready to officially launch. But maybe you’d still like a way to grow your email list and or social media following while you get your site ready.
In this case, it would make little to no sense to show an unfinished website with no content and a constantly changing design. An elegant solution is to enable maintenance mode which allows your visitors to sign up for your newsletter and follow you on social media.
There are a few different ways to put your website into maintenance mode. In the sections below, we’ll explore those options and the benefits and tools for each.
Note: As always, make sure you have a current and reliable backup of your site before making any changes. For more information on how to backup your site, check out 4 Top WordPress Multisite Backup Solutions Tested and Reviewed and How to Backup Your WordPress Website (and Multisite) Using Snapshot. We always recommend backing up with our Snapshot plugin as it’s compatible with both standalone and Multisite sites.
Method 1: Built-In Maintenance Mode
The first way to put your WordPress website in maintenance mode happens without you having to actually do anything. WordPress has its own built-in method for creating and displaying a maintenance message and it happens every time you run an update, be it one for a plugin, theme, or the core files. WordPress automatically creates a .maintenance file in the root of your site’s installation that displays a message to anyone that might happen across your site during an update.
The message is straightforward and looks like the below:
“Briefly unavailable for scheduled maintenance. Check back in a minute.”
Once updates are completed, your site is automatically returned to normal and your visitors can freely continue to browse your website like nothing ever happened.
This method works great when all you are doing is updating your themes and plugins. However, if updates are going to take a while and/or you want to actually work on your site and make changes, there’s another way to display a maintenance mode message. Two ways, actually.
Choosing to do one of the following will show visitors a message of your choosing when you’re performing site maintenance while you still have access to your site’s front-end to see the effects any changes you make will have on the site’s design and function.
Method 2: Manual WordPress Maintenance
If you are comfortable with writing code and you don’t want to install yet another plugin, the easiest way to your website in maintenance mode is by adding a few lines of code to your functions.php file.
Your functions.php file can be found in Appearance > Editor. By default, the style.css file will open up first but on the right-hand side, you can see other files that make up your theme. Click on functions.php and at the very bottom, paste the following code then hit Save:
Note: We always recommend that you make changes to a child theme and not directly update your functions.php file. Check out our guide on How to Create a WordPress Child Theme for the full rundown.
The benefit of this approach is that everybody who is not logged into your website will see a maintenance page like in the screenshot below:
The administrator of the website–in this case, you–will still be able to access the website and see it displayed normally, allowing you the see all the changes you make on the backend. When you’re done with your maintenance work, simply delete the code you pasted into the functions.php and click Save which will make your site accessible to public again.
Method 3: Maintenance Mode Plugins
Finally, the third way of enabling maintenance mode is via plugins, which is especially handy if you don’t feel comfortable editing the code or want more customization than what the other two methods offer.
In this section, we’ll explore the best maintenance mode plugins currently available.
WP Maintenance Mode is a free plugin that lets you add a maintenance page to your site so you can let visitors know your blog is down for maintenance. There’s also the option of adding a coming soon page for new sites.
There are various options in the backend of the plugin so you can change the status of the plugin, bypass search bots, and set user level restrictions. With minimal setup, you can get a beautiful looking splash page up on your site in minutes. WP Maintenance Mode is great for WordPress Multisite installs – it allows you to manage each site’s maintenance settings separately.
With more than 700,000 active installs and 4.5 stars on WordPress.org, this plugin is hugely popular and worth checking out.
Slim Maintenance Mode is a lightweight plugin that puts your website into maintenance mode simply by activating the plugin. The plugin works with any theme and you can see an alert message in the backend when the plugin is active. It sends HTTP response status code 503 Service Unavailable, which is especially useful when it comes to search engines because it won’t hurt your rankings. To deactivate the maintenance mode simply deactivate the plugin.
Slim Maintenance Mode is free.
Maintenance is another super-popular plugin, with over 400,000 active downloads. All you have to do is hit install, then activate and voila, your site is already in maintenance mode. You can of course customize the screen your visitors will see, however if all you need is to quickly hide your site whilst you make some speedy changes, this plugin is perfect for your needs.
Oh, and it’s completely free!
CMP – Coming Soon & Maintenance Plugin is another free plugin with a ton of options. You can easily set your site to either coming soon or maintenance mode, with the clever code in the background informing indexing bots of the situation. You can also blacklist or whitelist specific pages of your site from the plugin, as well as customize all aspects of your holding page.
Minimal Coming Soon & Maintenance Mode allows you to fully customize your page, however if you opt for the PRO version, you will have access to features such as premium themes and animations for your page. My favorite things about this plugin is that the menu is hidden inside your WordPress settings rather than adding a new menu item to your dashboard. As a maintenance mode plugin isn’t something you should need to use often, it makes sense for it to be neatly tucked away.
Despite the somewhat long-winded name, Site Offline Or Coming Soon Or Maintenance Mode is pretty simple to use. Half of the plugin settings screen does consist of a giant advert for the pro version, therefore it’s definitely not my favorite free plugin, it comes with a nice countdown feature so it was worth a mention. Unfortunately besides that it’s a pretty basic plugin unless you pay the $19 dollars for the PRO version, but it should be more than suitable to create a simple holding page for your site.
Maintenance Mode Troubleshooting
At first glance, putting your website into maintenance mode and then disabling it once you’re done seems like a piece of cake. However, there are times when things go wrong and it’s possible for WordPress to get stuck in this mode. Thankfully, it’s an easy fix to get your site back to normal.
1. How to Take WordPress Out of Maintenance Mode
If you refresh the page while WordPress is performing a core, plugin, or theme update – in other words, you interrupt the update process, your website might get stuck in maintenance mode making your WordPress dashboard completely inaccessible. If that happens, all you have to do is manually take WordPress out if its built-in maintenance mode.
To do this:
- Log into your web host’s cPanel,
- Go to File Manager and click on the folder of your WordPress installation, and
- Delete a hidden file called .maintenance.
If you only have access to your website files via FTP then you will need to use a program like Filezilla to access your site’s files and make this deletion.
2. How to Take a WordPress Plugin Out of Maintenance Mode
When it comes to maintenance plugins, they can get stuck in maintenance mode as well if you have a caching plugin installed or your host is using a caching layer. In this case, you just need to clear the caching plugin’s cache or clear your host’s cache. Usually, your host will have a button in the WordPress admin that says “Clear Cache.” After you are done with maintenance work, it’s safe to deactivate and uninstall the plugin.
Putting your website into maintenance mode has a number of uses. It’s not reserved only for performing core and regular updates, but it is a useful tactic when you want to make major changes to your website’s design or functionality.
From simple maintenance messages to more complex designs which allow you to share more information with your website visitors and even collect email address or build your social media following, there is a way to enable maintenance mode for almost any situation imaginable.