Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Redirect Visitors to a Temporary Maintenance Page in WordPress with Maintenance Mode

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Redirect Visitors to a Temporary Maintenance Page in WordPress with Maintenance Mode

There are times we all need to do maintenance on our live site. This is not a problem when your site is not launched to public, but it can be a problem when you have a high traffic site. In order to prevent your users from seeing a broken version of your site and giving them a heads up on the updates, it is crucial that developers utilize the Maintenance Mode plugins in WordPress to redirect visitors to a temporary maintenance page. This maintenance page can show how much time it will take you to get back live, it can contain a simple message explaining what you are doing with a text (we will be back shortly) or what not. In this article, we will share two WordPress plugins that you can use to redirect your visitors to a temporary maintenance page while administrators can still work and access the site.

Maintenance Mode Plugin

Maintenance Mode plugin for WordPress is the most popular plugin with over 461K downloads. This plugin adds a splash page to your blog that lets visitors know that your blog is down for maintenance. Visitors normally see a message saying “Maintenance Mode – YourSiteName is currently undergoing scheduled maintenance. Please try back in XX days, XX hours, XX minutes. Sorry for the inconvenience”.

Maintenance Mode Plugin for WordPress

Logged in administrators (or other user level of your choice) will get full access to the blog including the back-end and the front-end. You can also limit which user type just sees the backend (i.e Editors) whereas only administrators see the front-end.

All you have to do is download “Maintenance Mode” plugin and activate it. Then go to the Settings » Maintenance Mode tab.

Maintenance Mode Plugin for WordPress - Settings

To enable the maintenance mode, you would need to select the Activated button. Select the Backtime, and then click save. The message field is only if you want to customize the message that is there. The plugin comes with 3 display options. One is the default theme, which is pretty ugly. Second is the WordPress Login theme which looks some what decent. The third option is to create a custom file to match your theme. You can create a custom theme by creating a file called “503.php” in your theme’s folder.

Maintenance Mode Plugin for WordPress - User levels

You can specify which user role gets access to the front-end, and which user role has access to the back-end only. Furthermore, you can also let some paths to be still accessible such as feeds, XML-RPC publishing, contact page, about page etc.

A good practice that we recommend is to use the conditional tag that reminds you to turn off the activation mode once you are done. Open your header.php file, and add this code after the body tag:

<?php if (function_exists('is_maintenance') && is_maintenance() ) {
	echo '<div style="padding: 3px; margin: 10px 0 10px 0; border: 2px solid red;">The Maintenance Mode is activated. Please don\'t forget to <a href="/wp-admin/options-general.php?page=maintenance-mode.php">deactivate</a> it as soon as you are done.</div>';
}?>

WP Maintenance Mode

WP Maintenance Mode is another popular plugin that we like because it has a lot more pre-made Maintenance Mode templates which is very helpful for beginners. This plugin adds a splash page to your site that lets visitor know your site is down for maintenance. Administrators or another specified user role will get full access to the back-end and the front-end.

First you need to download “WP Maintenance Mode” and activate it. Unlike other plugins, this plugin’s settings panel is on the Plugins page hidden with jQuery. We would much rather prefer a separate page, but this works for now.

WP Maintenance Mode Plugin - Settings

To activate the maintenance mode, you need to set the drop down button to True, and click Activate. This plugin also lets you select the countdown if you want. Unlike the Maintenance Mode that leaves it’s link in the footer of their designed pages, this plugin gives you the option to hide those links (this is something that every developer should do). Nobody should be forced to keep the links on the homepage. This plugin lets you specify a custom design as well except this one has the ability to add content via hooks rather than creating a separate file. It comes with a default template called “Own Theme”, and then you can specify a custom CSS url along with adding the content to any of the three hooks: wm_head, wm_content, wm_footer. Example of adding to the hooks would be the sample code below which you would paste in your theme’s functions.php file.

function add_my_link() {
echo '<a href="http://mylink.com/">My Link</a>
}
add_action( 'wm_footer', 'add_my_link' );

Check out some of the cool pre-made themes this plugin already comes with:

WP Maintenance Mode Plugin - Screenshots

To see all pre-made themes refer to the Screenshots section of the plugin.

You can use either one of these plugins to temporarily redirect your visitors to a maintenance page while you perform maintenance duties on your site.

This post is part of a Series

Redirecting Visitors a Temporary Maintenance Page without a Plugin

Six Types of Maintenance Page Designs – Which One Works for You?


Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Anne says:

    Hi there, do all plugins remain plugged in when you switch a theme? BTW thanks for this post. Really useful. I have found a theme I want to switch to but have been putting it off because I was scared it would ruin some of my hard work.

  2. shaswat49 says:

    I enabled maintenance mode plugin but how to get out of it. I mean I disabled but still its showing the maintenance page. how to fix this ? Please help

  3. ketul says:

    Thanks for share valuable information.

  4. Keith Broadbent says:

    I have used this plugin for about a year on several wp sites. Suddenly, while in maintenance mode, I cannot get back into irepair4less.com/wp-admin to get in to turn it off. I can get to my ftp client and delete that plug-in. what is the fix?

  5. Gary says:

    How do you allow admins and editor to see the pages while in maintenance mode? I only see an option to select either admins OR editor but not both.

    • Editorial Staff says:

      All admins have the editor permissions. So if you select editors, then admins by default will be able to see it.

  6. marijnbent says:

    I used the plugin WP Maintenance Mode, but i doesn’t get ‘out’ the maintenance mode. I tried all the setting but it doesn’t work. Can anyone help me?

  7. Jean-Marc Buytaert says:

    Why not just set the Front Page Display to a static page (Settings > Reading)?

    • Editorial Staff says:

      Because users can still access the other pages in the site. If you have backlinks to single posts from other sites, those people can see the broken site. The whole idea of maintenance pages is to keep user experience to the maximum by letting them know about whats going on.

  8. Rolands says:

    till now I’m using built-in functionality: .maintenance in root + maintenance.php in /wp-content/

    ;)

  9. Gemma says:

    Thanks for this! I have used JF3 Maintenance Redirect in the past and it’s a good alternative for designers and developers who need to allow their clients to preview the site before releasing it for public viewing. It also works well for working on your own sites.

  10. Jan says:

    I am using a plugin named ‘lock out’, where you get two boxes in the settings to put your own html and css into. It’s redirecting the visitors to a page named lockout.php, whereas access through wp-admin is still possible.

    Perhaps it’s worth a look for the more html and css-savvy people.

  11. Charlie says:

    Handy! I had been using WP-Maintenance-Mode but I prefer “Maintenance Mode” with the login screen look-a-like.

  12. Connor Crosby says:

    I wish my tutorial about the custom coming soon page would be posted :(

  13. Pixelbits says:

    There is an excellent plugin called ‘Anticipate’.

    Unlike the mentioned plugins this one enables you to display some pages (like intro, contact, subscribe, portfolio) of your site while you are building the new one. Perfect if you do not want to go offline completly ;)

    View it here: http://www.elegantthemes.com/gallery/anticipate/

    • Editorial Staff says:

      These plugins allow you to whitelist pages such as about, contact, intro, or whatever other page you want.

  14. Mani Viswanathan says:

    I had tried this plugin when I was redesigning my blog on a different domain with current. So to avoid SEO issues I blocked the SE’s & activated this plugin.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.