How to put your WordPress Site in Maintenance Mode? (with Video)

WordPress Maintenance Mode - Coming Soon Page - LearnWoo Banner

Last updated - July 24, 2019

The beauty of WordPress is that it can be customized any way you want. On the downside, such major customization can affect your website heavily. If you looking to customize or fix your website, a better option is to put your WordPress site in maintenance mode.

In this article, we will learn what is WordPress maintenance mode and ways to achieve this.

What is “WordPress maintenance mode”?

A WordPress maintenance mode is a state in your website where you make the content unavailable to users. The site owners usually put their site in maintenance mode to perform administrative activities like fixing a broken site, moving to a completely new website, revamping your site, applying a new theme that could affect the site excessively, fixing a major security issue/bug, and other such tasks that you know might affect the complete working of the site.

The maintenance mode works as a “coming soon page” or “under construction mode” for site owners with new websites. Some of the site owners use this mode to make their half-built site go live. This helps them improve their site in multiple aspects by analyzing live usage.

You must have noticed a “maintenance mode” message while updating your plugins. This is because your website goes into a temporary maintenance mode while updating the plugins. Therefore, you are advised not to cancel or move to other settings.

Why do I need a WordPress maintenance mode?

If you have a fairly new site, an attractive coming soon page will generate curiosity among the users. Additionally, if you are able to get user data to inform them about the launch, it could help you build an audience for your business.

If you are a big brand or have a fair business up and running, a broken website may hit your brand value. Your existing audience might lose interest due to your faulty website. It could also lead to a bad impression on users who are visiting your site for the first time. Also, if search engines encounter faulty pages in your website, they will throw an error and not index your site. The maintenance mode returns a 505 error to inform Google to stop indexing your site for that time.

Hence, the maintenance mode is a good cover up to your back-end activities that might show up on your front-end of the website. But you should note that you do not need to switch to this mode for minor administrative tasks like updating themes, plugins, adding simple code snippets, among other tasks that may not affect the core working of the site.

WordPress Maintenance Mode | Coming Soon!
Coming Soon!

How to put WordPress in maintenance mode?

There are three methods to do this:

  1. Using a simple code snippet
  2. Using .htaccess file
  3. Using Free WordPress plugins

1. Using a Simple Code Snippet

This method is suitable for new websites as they do not have an audience to lose. This method is also simple and cost-effective.

You need to add the following code snippet to the functions.php file of your website’s current theme.

// Activating WordPress Maintenance Mode
function wp_maintenance_mode() {
 if (!current_user_can('edit_themes') || !is_user_logged_in()) 
 { 
    wp_die('<h1>We are down for Maintenance</h1><br/>We will be back shortly!');
  }
}
add_action('get_header', 'wp_maintenance_mode');

Tip: Read how to update code snippets in the functions.php file?

The above code snippet works for users who are not logged in to your website. The below screenshot shows how the maintenance mode is enabled.

WordPress Maintenance Mode | Maintenance Mode with Code Snippet
Maintenance Mode with Code Snippet

If you want to toggle enabling the maintenance mode, you can comment the add action() filter as shown below, and remove the comment line “//” to enable maintenance mode again.

//add_action('get_header', 'wp_maintenance_mode');

2. Using .htaccess file

The .htaccess file resides on your website’s home (root) folder. But before you make changes to this file, you should make a backup of the file to a different name, say “.htaccess_source”. You can then copy and paste the below code to the file.

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

You can notice the “maintenance.html” in the above code. You should create this maintenance page before you add the above code to the .htaccess file. You can customize this page as you like.

3. Using Free WordPress Plugins

Using plugins are way more efficient when compared to code snippets. This method is for those who do not want to touch their back-end files and want to work from the front-end. Having said that, the plugins could go out of control, especially when it comes to security fixes.

Nevertheless, we will look into some of the popular plugins that do the job very well.

1) Coming Soon Page & Maintenance Mode by SeedProd

One of the most popular plugins used for coming soon page and maintenance mode. You can use this plugin for a simple maintenance mode page, that allows you to include logos, headlines, text, custom header logo, SEO title, SEO meta description, and Google Analytics code.

In addition to this, you can add a custom background color or image, make your background responsive, customize text color, link color, headline color, and text font. You can also add custom CSS of your own.

WordPress Maintenance Mode | Coming Soon Page plugin by SeedProd
Coming Soon Page & Maintenance Mode plugin by SeedProd

The premium version has tons of exciting features like real-time page customizer, pre-made themes, email collection (using MailChimp AWeber, Get Response, Constant Contact, & Campaign Monito), background slide show & videos, password protection, built-in referral system to keep track referred subscribers, multisite support, and much more!

Download the Plugin | Check out the Premium Version

2) WP Maintenance Mode

Another popular alternative. This plugin allows you to set a countdown timer, subscription form, contact form, social network links, and Google Analytics support. For the background of the page, you can choose a predefined photo, upload a custom photo, or keep a simple custom color. The pages are responsive and work well in multisite as well.

WordPress Maintenance Mode | WP Maintenance Mode plugin
WP Maintenance Mode plugin

With this plugin, you can choose WordPress user roles for whom you want to allow access to the back-end and front-end of your website. You can even exclude pages, bypass search bots, robots meta tag configuration, and redirection.

One of the coolest features is the ChatBot. Instead of the usual text and countdown, you can create predefined chat messages that will work as a conversation with the visitors. You can accept user information like name and email as part of your conversation. Additionally, you can upload your own photo and give a real person name to create a feeling of real conversation. A sample page is shown in the screenshot below.

WordPress Maintenance Mode | WP Maintenance Mode ChatBot
WP Maintenance Mode ChatBot

Download the Plugin

3) Under Construction

The Under Construction plugin provides an easy toggle to enable under construction mode, prevent the search engines from indexing your site temporarily, automatic countdown timer, and Google Analytics.

WordPress Maintenance Mode | Under Construction plugin
Under Construction plugin

Not just this, the plugin offers some free themes that make your site look attractive. You can also whitelist specific user roles and user accounts to access your site. Also, you can customize the title, description, headline, content, and social network links.

Download the Plugin

4) Maintenance

In addition to title, headline, description, footer, logo, and background, this plugin offers custom CSS feature, blur intensity, enabling/disabling 503 error, and Google Analytics support. The plugin also allows you to exclude certain WordPress posts, pages, and WooCommerce products.

WordPress Maintenance Mode | Maintenance plugin
Maintenance plugin

The pro version offers unique scheduler countdown, user permissions, fullscreen background, background video from YouTube or Vimeo, social media profiles, email subscriptions from MailChimp and Campaign Monitor. If your website’s target audience is spread across for multiple regions, the plugin supports translation for several languages.

Download the Plugin | Check out the Premium Version

5) Minimal Coming Soon & Maintenance Mode – Coming Soon Builder

This plugin offers minimal design for creating coming soon or the maintenance mode page of your website. You can also collect emails using Optin pop-ups that are integration with MailOptin. You can collect emails using MailChimp from your visitors.

WordPress Maintenance Mode | Minimal Coming Soon - Coming Soon Builder
Minimal Coming Soon & Maintenance Mode – Coming Soon Builder

The pro version provides a lot of themes, free images, SEO tools, caching plugin support, and custom user access.

Download the Plugin | Check out the Premium Version

You can also check out the video tutorial below.

If you are looking for Premium plugins, read the below article.

Top Under Construction Plugins for WordPress & WooCommerce Sites

What are the alternatives for maintenance mode?

An efficient alternative is to use Staging sites. Staging site acts as a mirror to your live site. You could test your settings in the staging environment, and once you are happy with the settings, you can apply the same settings to the live site. Most of the hosting service providers have the staging site facility. You can check your account dashboard or contact them for this service.

But remember, it might have some repercussions as the errors in staging site can be copied to live site as well. Hence, you need to check your settings thoroughly and apply them to the live site.

Suggested reading:


You can check out blog articles on WordPress BasicsWordPress Security & Performance, or WooCommerce customizations for learning about different aspects of WordPress and WooCommerce.

Or continue exploring LearnWoo for more amazing articles.

LEAVE A REPLY