WordPress maintenance mode: How to make your website temporarily unavailable

How to put your site under maintenance or in coming soon mode

WordPress maintenance mode is a state you can place your website in should you need to perform updates, implement changes to the design or content, or fix a security flaw. It essentially replaces your website with a splash page that explains why it’s offline and when you expect it to be live again.

Maintenance Mode
Image Source: EstudioWebDoce – Pixabay.com / License: CC0 Public Domain

There are many different reasons as to why you would want to put your WordPress site into maintenance mode as well as many different ways to do so. We’ll be covering all of this in this post, starting with going over what WordPress maintenance mode is and ways to put your site in this state. We’ll then cover each method you can use to enable maintenance mode before wrapping up with a few issues that can occur when you use it. Let’s get into it.

What is WordPress maintenance mode?

WordPress maintenance mode is a state you can put your website into when you need to take care of a few administrative tasks that would affect the site’s performance or otherwise make it unusable. In a perfect world, your website wouldn’t experience any downtime. However, sometimes it’s best to take your site offline and replace it with a “be back soon” splash page rather than run the risk of endangering customers’ personal data and money with a faulty website. Let’s go over a few additional purposes for WordPress maintenance mode.

Reasons to use WordPress maintenance mode

Construction / Mechanical Engineering
Image Source: WiR_Freebies – Pixabay.com / License: CC0 Public Domain

Maintenance mode is most commonly used by existing sites. Because of this, there are two main reasons for using it:

  1. You need to make changes to your site’s design, WordPress theme or content.
  2. You need to fix a major bug that could potentially affect your users’ data.

It may not feel like a big deal to make cosmetic changes to your site while it’s live, but it may actually throw some users off. Some may leave thinking your site is broken while others may leave thinking your site has been hacked. Some may return, but the majority will likely move on to the next site. That’s why some maintenance mode page designs come with email forms. That way you can stay in touch with your audience while your website is down.

As for the second reason, it’s always a good idea to take your site offline if it has a major security bug, even if you don’t collect user data. The logic here is that some hackers may insert links that lead to phishing sites where users have the potential to be scammed. The best thing to do is take your site offline and enable maintenance mode instead while you work out the kinks. You may turn away customers for a few hours, but at least you’ll keep your reputation. Once the issues on your site are fixed, you can put the site back online.

There is a third reason for using WordPress maintenance mode, but it relates to new sites rather than existing ones. It’s a coming soon page, and it’ll help you build hype for your yet-to-launch site. It uses the same plugins / code as maintenance mode does. You simply change the page content to indicate it’s a coming soon page rather than a general maintenance page. Let’s briefly touch base on the methods you can use to enable this feature in WordPress.

How to enable WordPress maintenance mode

Website Under Construction
Image Source: geralt – Pixabay.com / License: CC0 Public Domain

There are four main methods you can use to enable WordPress maintenance mode on your site:

  1. Use the built-in maintenance feature in WordPress
  2. Add custom code to display a maintenance page
  3. Enable maintenance mode through your .htaccess file
  4. Use a WordPress maintenance mode plugin

Each of these methods implement maintenance mode in different ways. You don’t have much control over the first method, but you can choose between the second and third methods carefully. Your choice should depend on how long you plan on using maintenance mode and what purpose(s) you want it to serve. Let’s talk about them.

Method #1: The maintenance function in WordPress

The maintenance function in WordPress is a built-in feature that occurs automatically when you update WordPress core and run plugin or WordPress theme updates. The way it works is simple. When you run an update, WordPress displays a message in the admin area stating the site has entered maintenance mode. Maintenance mode is deactivated once the update completes.

WordPress Maintenance Mode
Image Source: Screenshot – WordPress Dashboard

WordPress updates shouldn’t take longer than a minute, but during that minute, your site will be replaced by this splash page:

WordPress Maintenance Splash Page
Image Source: Screenshot

This page is created by a temporary file called .maintenance that only appears in your file directory when you run updates in WordPress. Again, you have little control over this method, so it’s best not to worry about it as it only covers you when you run updates through the WordPress core update mechanism.

Method #2: Custom code to display a maintenance page

Coding
Image Source: StockSnap – Pixabay.com / License: CC0 Public Domain

If you want to display a basic maintenance splash page on your site without using a maintenance mode plugin, you can add this bit of code to your functions.php file or by using a plugin to add code snippets:

// Activate WordPress Maintenance Mode
function wp_maintenance_mode() {
    if (!current_user_can('edit_themes') || !is_user_logged_in()) {
        wp_die('<h1>Under Maintenance</h1><br />Something ain't right, but we're working on it! Check back later.');
    }
}
add_action('get_header', 'wp_maintenance_mode');

It forces your site into maintenance mode and displays the message you write following the H1 tag.

Manual WordPress Maintenance Mode
Image Source: Screenshot

You’ll need to log out of your site to view this splash page, but it does work.

Method #3: Enable maintenance mode through your .htaccess file

Access Denied
Image Source: typographyimages – Pixabay.com / License: CC0 Public Domain

For this approach it is necessary to have permission to edit the .htaccess file on your server. This file can be found in the root directory of your website. Once you have this file opened, copy and paste the following code:

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.123
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ https://example.com/maintenance.html [R=307,L]

This code will redirect all web requests coming to your homepage to a maintenance.html file that you will have to create first, as you will be using it as a temporary homepage replacement. You can find many simple maintenance page HTML templates online. Pay close attention to the %{REMOTE_ADDR} part, which is where you have to replace the numbers with your own IP address, as this will allow you to access the site no matter what.

Method #4: Using WordPress maintenance mode plugins

Putting your website in maintenance mode with code is a decent way to let users know what’s going on when you actually need to take it offline for maintenance. However, it’s not the most effective method to use in terms of business and keeping your conversions afloat. You’re much better off using a maintenance mode plugin. These plugins allow you to build aesthetically-pleasing splash pages you can insert email forms and social media links into.

Maintenance Mode Plugins
Image Source: Clker-Free-Vector-Images – Pixabay.com / License: CC0 Public Domain

We’re going to go over some of the best maintenance mode plugins available for WordPress.

Maintenance

FruitfulCode Maintenance Plugin
Image Source: Screenshot – WordPress.org

Maintenance is a maintenance mode WordPress plugin by Fruitful Code. It comes in free and premium formats. The free version is incredibly simple and perfectly capable of putting WordPress in maintenance mode. Its capabilities are similar to what you see in the screenshot above. You can add a background, basic text and custom code. You can also choose specific pages and posts to disable the maintenance functionality on.

This can be useful if there are specific parts of your website that won’t be worked on. There’s also a setting that allows you to enable the 503 status code, a standard code used to let users know their request cannot be completed because the “server is currently unable to handle the request due to a temporary overload or scheduled maintenance”.

The premium version comes with a lot more features that can turn your run-of-the-mill maintenance page into a conversion machine. Features include the ability to add an animated countdown element, the ability to use video backgrounds, and email forms for MailChimp and Campaign Monitor. This version is available for a base price of $25 with an annual fee of $18 for ongoing support.

Maintenance Mode by SeedProd

Maintenance Mode by SeedProd
Image Source: Screenshot – WordPress.org

Maintenance Mode by SeedProd is a hybrid maintenance plugin that allows you to create maintenance and coming soon pages. Similar to the previous plugin, the free plugin is essentially a stripped-down version of the premium one. You can change your background, change the text you use, and add custom HTML and CSS. It’s a bit more complex than that, however, which you can tell by the way the plugin splits the settings into different tabs.

The premium version has a lot of technical and aesthetic features added to it. It allows you to build a completely custom design without needing to know how to code, for one. You can also embed videos, add email forms, add contact forms, add a progress bar to showcase how far along you are in maintenance, etc. Pricing for the premium version of this maintenance mode and coming soon plugin starts at $29 / year.

Minimal Coming Soon & Maintenance Mode

Minimal Coming Soon & Maintenance Mode Plugin
Image Source: Screenshot – WordPress.org

Minimal Coming Soon & Maintenance Mode is a powerful WordPress maintenance mode plugin that packs a lot of premium features into a free product. You can set up a background and showcase headings and descriptions, but you can also do things like add email forms and use Google Fonts. It doesn’t have a countdown element, but you can add your own HTML and CSS snippets. This one is a great choice if you’re looking for a free plugin without upsell.

Coming Soon & Under Construction Maintenance Page

Coming Soon & Under Construction Maintenance Page Plugin
Image Source: Screenshot – WordPress.org

Coming Soon & Under Construction Maintenance Page is a free plugin that isn’t nearly as popular as the plugins listed above. However, it’s still fairly powerful. It’s also a great budget option if you can’t afford to pay for the premium versions the other plugins are available in. You can start by adding a background image as well as a heading and text stating why the user is seeing this page.

You can also, however, add a countdown element and a simple email form. These are two powerful features the other plugins only allow in their premium versions. The background can even be presented as a slider, and you’ll have over 300 Google Fonts to choose from. Overall this free coming soon plugin definitely is worth a try.

Under Construction

Under Construction Plugin
Image Source: Screenshot – WordPress.org

Under Construction is a fairly popular maintenance mode plugin that comes in free and premium formats. The free version comes with over 25 themes, one of which can be seen in the screenshot above. You can also assign a date and time so the plugin can take your site out of maintenance mode automatically. You can also add content, social media links and custom code. This is a simple, no-nonsense plugin to hide your site behind a under construction page.

The premium version comes with over 100 templates, and you can choose from a library of over 400,000 images. The premium version even comes with a drag-and-drop builder. Other premium features include the ability to add a contact form and the ability to add per-page rules. Pricing for the premium version starts at $25 / year.

WP Maintenance Mode

WP Maintenance Mode Plugin
Image Source: Screenshot – WordPress.org

WP Maintenance Mode is a powerful, popular and free maintenance mode plugin by Designmodo. It comes with a structured theme you can customize with different backgrounds, content and colors. You can even add things like contact forms, email forms, social media links and a countdown timer. This free maintenance mode plugin even has a few templates for coming soon and landing pages.

Elementor

Elementor Plugin
Image Source: Screenshot – WordPress.org

You’ve probably heard of Elementor. It’s a free, drag-and-drop page builder plugin that makes it easy for anyone to design and build their own pages in WordPress. It has a premium version, but the free version is capable of producing many different page designs. This includes a maintenance mode page, which you can enable in the tools menu.

Elementor Maintenance Mode
Image Source: Screenshot – Elementor Plugin

You’ll need to have already created a template for maintenance mode, which you can do in different ways. You can either design your own page using Elementor and save it as a template, or you can import one of Elementor’s. All of their predesigned maintenance templates are labeled as “Coming Soon” pages. You’ll need the premium version of Elementor if you want to access every maintenance mode template.

It’s best to start by creating a new page and using the Elementor Canvas template so your header and footer are hidden. You can then build your own design or add a Coming Soon template, and save the page. You’ll be able to select the template in the Maintenance Mode tab under Elementor → Tools after that.

Now that you have a few suggestions to look through, let’s go over some of the issues you may face when using WordPress maintenance mode. We’ll wrap the post up after that.

How to get a WordPress site out of maintenance mode

Push Button
Image Source: aitoff – Pixabay.com / License: CC0 Public Domain

So, we went over how to put a WordPress site in maintenance mode, but what happens when you have a site that’s stuck in maintenance mode? That’s what we’re going to go over in this next section. There are a few different reasons your site may get stuck in this mode, but they mostly boil down to these:

The .maintenance File

If you ran WordPress updates and are now stuck with that screen we showed earlier…

WordPress Maintenance Splash Page
Image Source: Screenshot

…your directory probably failed to delete the .maintenance file after the updates completed. It’s an easy fix if you know how to access your site’s file system. If your host uses cPanel or a similar control panel, open its file system. You can also use an FTP software, such as FileZilla.

The .maintenance file is what’s known as a “dot file”, which are hidden by default in most file managers. You’ll need to enable a feature called “Make Hidden Files Viewable”. Different file managers label this feature differently.

The file will be located in your main directory, which is the same location your wp-config.php file is located in. All you need to do is select the .maintenance file and delete it by clicking the Delete button in the file manager or by right-clicking (control clicking on Macs) the file and selecting “Delete”.

Maintenance mode plugin glitches

Failure
Image Source: RyanMcGuire – Pixabay.com / License: CC0 Public Domain

If you used a plugin to put your site in maintenance mode and can’t remove the splash screen despite turning the feature off in the settings, you’ll need to deactivate and delete the plugin. Clear your site’s cache if that doesn’t work. You can do this in two ways:

  • Cache pluginW3 Total Cache, WP Super Cache, WP Fastest Cache, etc. Just install one of these plugins, and use the Clear Cache feature. It’s similar to clearing the cache on your browser, phone or computer.
  • Your host’s control panel – Some hosts, especially managed WordPress hosts, have an option in their control panels that allow you to clear your site’s cache with a click of a button. You’ll likely need to use this option anyway if you use a managed WordPress host as some of them do not allow you to install caching plugins on your server. This is because they are already handling caching on your behalf.

Fortunately, it is possible to prevent your site from getting stuck in maintenance mode. The only thing you need to do is follow a few best practices. Let’s cover that topic before we wrap this post up.

How to prevent your site from getting stuck in WordPress maintenance mode

Caution
Image Source: ferarcosn – Pixabay.com / License: CC0 Public Domain

There are three main causes that may lead to your site getting stuck in maintenance mode:

  1. You attempted to update several WordPress themes and plugins at once, resulting in an error.
  2. A plugin you attempted to update is not compatible with your version of WordPress.
  3. A glitch occurred in the maintenance mode plugin you use.

Handling several updates at once

Updates
Image Source: geralt – Pixabay.com / License: CC0 Public Domain

The first thing you can do is ensure you start creating regular backups, and back your site up before you run updates. You can use WordPress plugins to create restore points that will allow you to restore your site to the last day it was functioning correctly. This doesn’t necessarily provide a way to prevent this from happening to your site, but it does provide a solution in case it ever gets stuck in this state. It’s better to be safe than sorry.

Compatibility issues with WordPress

You can also make sure you keep your WordPress version up to date, and make sure any WordPress plugin you update is compatible with your version of WordPress. Fortunately, WordPress now comes with a feature that tells you if a WordPress plugin is compatible with your version of WordPress right there on the Updates screen.

WordPress Update Compatibility
Image Source: Screenshot – WordPress Dashboard

It’s a simple rule to follow – don’t update a theme or plugin unless it’s 100% compatible with your version of WordPress, “according to its author”. You should also test updates in a controlled environment. There are a few different ways to do this, the most popular being site staging and transferring your site to a local test server.

See if site staging is included in your hosting plan. If so, you’ll be able to clone your site to another location on your server, and test the updates there. If not, you can use a dedicated staging service, purchase a cheap shared hosting plan to use as a test server or create your own server on your desktop with a program like MAMP.

Preventing plugin glitches

Working with notebook
Image Source: StartupStockPhotos – Pixabay.com / License: CC0 Public Domain

There aren’t many ways to prevent a glitch from occurring in a plugin, but you can at least research the plugins you use. This will allow you to only install plugins that have great reputations for providing clean and well-functioning code, which can increase your likelihood of preventing your site from getting stuck in maintenance mode.

Final thoughts

WordPress maintenance mode is a useful feature that can help you better communicate with your users when your site goes offline for scheduled and unscheduled maintenance. It can even help you maintain your conversion rates even when your site goes offline. This is especially important if you’re running a professional online business.

It’s best to use a dedicated maintenance plugin that will allow you to increase conversions. This allows you to build hype for your brand without losing visitors. The hard part is determining which maintenance page plugin suits your needs best. We want to hear from you. What are some of your reasons for using WordPress maintenance mode, and what are your favorite ways of implementing it? Let us know in the comments below!

Share this with your friends

2 Comments

  1. Hi, just a quick one, how do I hide my site from public while I’m still developing without purchasing extra features?

Leave a Comment

Your email address will not be published.


*