To keep your website tech­ni­cal­ly updated, you should edit it once in a while. This usually involves updates, such as ones from plugins or WordPress itself. Since the site is not available online during the updating process, WordPress offers the Main­te­nance Mode, which avoids ir­ri­tat­ing visitors with an error message. If you activate it while making technical edits, for example to the theme or template, visitors are shown a special main­te­nance mode page.

$1 Domain Names – Grab your favorite one
  • Simple reg­is­tra­tion
  • Premium TLDs at great prices
  • 24/7 personal con­sul­tant included
  • Free privacy pro­tec­tion for eligible domains

With the main­te­nance mode, you avoid dis­play­ing an error message or, worse, the “White Screen of Death,” on your site, otherwise known as the blank page on WordPress. An example of a standard error page is one that displays HTTP-Error 503 “Service Un­avail­able”:

This leaves visitors in the dark about why your site is un­avail­able. If worst comes to worst, people will think your website was per­ma­nent­ly shut down. But keeping your readers updated with the main­te­nance mode will prevent you from losing them. The displayed site could look something like this:

This allows visitors to im­me­di­ate­ly see that your website is tem­porar­i­ly offline. Fur­ther­more, you can house contact in­for­ma­tion and other useful features on the briefly displayed site. That way, you won’t be aban­don­ing your readers.

How do I activate main­te­nance mode?

WordPress Main­te­nance Mode can be activated manually or with a plugin. Which one is more ap­pro­pri­ate depends on which updates you are planning to make and what your level of knowledge is. If it is just a case of small edits, it is generally not necessary to use a plugin. However, if the update is costly and your web project is extensive, an ad­di­tion­al plugin can be ad­van­ta­geous. For instance, this can allow you to au­to­mat­i­cal­ly inform your readers on how long the main­te­nance will last and when the site will be available again.

Note

Since its version 3.0, WordPress has had its own main­te­nance mode, which it au­to­mat­i­cal­ly switches to as soon as a theme or plugin is updated. You can activate or de­ac­ti­vate it yourself, without needing to install sup­ple­men­tary add-ons.

Ac­ti­vat­ing main­te­nance mode without a plugin

If you want to manually switch to WordPress Main­te­nance Mode, you can add a file named .main­te­nance (note the period) to the root directory. In this file, insert the following PHP code:

<?php $upgrading = time(); ?>

This file is au­to­mat­i­cal­ly added, and generally also removed, when you use a plugin for main­te­nance mode. WordPress will also load it if it was manually generated. The received timestamp should be released, but you shouldn’t forget to delete the file after the main­te­nance is completed.

Another option for manually starting the main­te­nance mode is conducted with the functions.php file. functions.php is a template file that is used to add functions and features to the WordPress project. In this case, you enter a PHP code into the file, which serves to activate the main­te­nance mode. There are different types of such PHP codes. A possible entry into functions.php looks like this, for example:

<?php
function maintenace_mode() {
    if ( !current_user_can( 'administrator' ) ) {
        wp_die('Maintenance.');
    }
}
add_action('get_header', 'maintenace_mode');
?>

You can also enter a text, which is then displayed on the site during the main­te­nance. It is possible to include images, as well. This requires the necessary PHP know-how, however. A simple entry into functions.php can look something like the following:

function kb_maintenance mode() {
    if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) { 
    wp_die('
        <h1>We are updating our website</h1>
        <p>We are currently working on this website. Please check back soon.</p> ', 'Website in Maintenance Mode');
}} 
add_action('get_header', 'kb_maintenance mode');

These codes pull up WordPress’ standard main­te­nance mode page. It is rel­a­tive­ly easily set up.

How to activate the main­te­nance mode with a plugin

If you are not sure if you can handle the root directory and PHP, you can activate WordPress Main­te­nance Mode easily and quickly with a plugin. The ap­pro­pri­ate plugin differs depending on your demands. Two of these will now be in­tro­duced. A WordPress plugin that provides many options for creating a main­te­nance mode page is simply named Main­te­nance. This plugin supplies different layout options for the site, which users are shown during main­te­nance. These layout options can be com­plete­ly in­di­vid­u­al­ized: from text and color scheme all the way to the back­ground, you can adjust and change every­thing as you see fit. For example, you can insert a countdown that indicates when the website will become available again. This also works with multi-site in­stal­la­tions (each blog has its own main­te­nance mode settings in the network). Fur­ther­more, you can give users the option to sign up for a newslet­ter while the main­te­nance is occurring. This function informs readers about the goings-on of the site and when it will be live again.

Coming Soon Page & Main­te­nance Mode by SeedProd is also a good plugin for informing readers about the main­te­nance work being done on the website. This plugin allows you to add a heading, an SEO title, and a meta de­scrip­tion. Ad­di­tion­al­ly, it is possible to upload a logo or a teaser image, as well as to adjust the site in terms of visuals and content.

The advantage of this WordPress main­te­nance page plugin is that one can exclude subpages from the main­te­nance process, so that search engine bots can continue crawling the website while you make updates. A website that is com­plete­ly in main­te­nance mode is clas­si­fied as un­avail­able by web crawlers.

Domain Name Reg­is­tra­tion
Build your brand on a great domain
  • Free Wildcard SSL for safer data transfers 
  • Free private reg­is­tra­tion for more privacy
  • Free Domain Connect for easy DNS setup

What do you have to watch out for in main­te­nance mode?

If you operate a non­com­mer­cial site, you can choose which in­for­ma­tion to provide in the main­te­nance no­ti­fi­ca­tion. However, those who operate a com­mer­cial site must note: main­te­nance mode doesn’t release you of your oblig­a­tion to continue providing all mandatory parts of your legal terms. In other words, the webpage that is displayed during your main­te­nance process should include the legal terms. The legal terms section also includes details such as the e-mail address or mailing address of the website operator. Whatever your reason is for going into main­te­nance mode, it’s advisable to give your customers the op­por­tu­ni­ty to contact you – not only because it’s good service, but also because it allows you to answer questions such as the website downtime or specific main­te­nance pro­ce­dures.

Which problems arise during the main­te­nance mode?

With the ac­ti­va­tion of WordPress Main­te­nance Mode, the temporary .main­te­nance file (which you can also manually create; see earlier section) is created in the main folder. After a suc­cess­ful con­clu­sion to the main­te­nance process and the end of the main­te­nance mode, this file is usually deleted. Oc­ca­sion­al­ly, however, an update is not correctly concluded. For example, this can happen if WordPress is ac­ci­den­tal­ly closed during the main­te­nance process, or if the update is aborted because the plugin takes unusually long to load. In this case, the file is not closed, leaving you stuck in WordPress Main­te­nance Mode.

This problem can be easily fixed by manually deleting the .main­te­nance file. The only pre­req­ui­site for this is that you have the ability to access your web project via FTP (file transfer protocol).

Fact

FTP is a standard network protocol that transfers files between two hosts.

In order to delete the .main­te­nance file manually, follow these steps:

  1. Access the webserver with an FTP program (such as FileZilla)
  2. Switch into the root directory of WordPress
  3. Delete the .main­te­nance file
  4. Update again, if needed

If this doesn’t work, contact your website’s hosting provider, who can assist with further trou­bleshoot­ing.

Go to Main Menu