To keep your website tech­nic­ally 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­ten­ance Mode, which avoids ir­rit­at­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­ten­ance mode page.

Cheap domain names – buy yours now
  • Free website pro­tec­tion with SSL Wildcard included
  • Free private re­gis­tra­tion for greater privacy
  • Free Domain Connect for easy DNS setup

With the main­ten­ance 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­man­ently shut down. But keeping your readers updated with the main­ten­ance mode will prevent you from losing them. The displayed site could look something like this:

This allows visitors to im­me­di­ately see that your website is tem­por­ar­ily offline. Fur­ther­more, you can house contact in­form­a­tion and other useful features on the briefly displayed site. That way, you won’t be abandon­ing your readers.

How do I activate main­ten­ance mode?

WordPress Main­ten­ance 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­vant­age­ous. For instance, this can allow you to auto­mat­ic­ally inform your readers on how long the main­ten­ance will last and when the site will be available again.

Note

Since its version 3.0, WordPress has had its own main­ten­ance mode, which it auto­mat­ic­ally switches to as soon as a theme or plugin is updated. You can activate or de­ac­tiv­ate it yourself, without needing to install sup­ple­ment­ary add-ons.

Ac­tiv­at­ing main­ten­ance mode without a plugin

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

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

This file is auto­mat­ic­ally added, and generally also removed, when you use a plugin for main­ten­ance 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­ten­ance is completed.

Another option for manually starting the main­ten­ance 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­ten­ance mode. There are different types of such PHP codes. A possible entry into functions.php looks like this, for example:

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

You can also enter a text, which is then displayed on the site during the main­ten­ance. It is possible to include images, as well. This requires the necessary PHP knowledge, 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­ten­ance mode page. It is re­l­at­ively easily set up.

How to activate the main­ten­ance mode with a plugin

If you are not sure if you can handle the root directory and PHP, you can activate WordPress Main­ten­ance 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­ten­ance mode page is simply named Main­ten­ance. This plugin supplies different layout options for the site, which users are shown during main­ten­ance. These layout options can be com­pletely in­di­vidu­al­ised: from text and color scheme all the way to the back­ground, you can adjust and change everything 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­stall­a­tions (each blog has its own main­ten­ance mode settings in the network). Fur­ther­more, you can give users the option to sign up for a news­let­ter while the main­ten­ance is occurring. This function informs readers about the goings-on of the site and when it will be live again.

Coming Soon Page & Main­ten­ance Mode by SeedProd is also a good plugin for informing readers about the main­ten­ance 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­ally, 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­ten­ance page plugin is that one can exclude subpages from the main­ten­ance process, so that search engine bots can continue crawling the website while you make updates. A website that is com­pletely in main­ten­ance mode is clas­si­fied as un­avail­able by web crawlers.

Register your domain name
Launch your business on the right domain
  • Free WordPress with .co.uk
  • Free website pro­tec­tion with one Wildcard SSL
  • Free Domain Connect for easy DNS setup

What do you have to watch out for in main­ten­ance mode?

If you operate a non­com­mer­cial site, you can choose which in­form­a­tion to provide in the main­ten­ance no­ti­fic­a­tion. However, those who operate a com­mer­cial site must note: main­ten­ance mode doesn’t release you of your ob­lig­a­tion to continue providing all mandatory parts of your legal terms. In other words, the webpage that is displayed during your main­ten­ance 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­ten­ance mode, it’s advisable to give your customers the op­por­tun­ity 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­ten­ance pro­ced­ures.

Which problems arise during the main­ten­ance mode?

With the ac­tiv­a­tion of WordPress Main­ten­ance Mode, the temporary .main­ten­ance 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­ten­ance process and the end of the main­ten­ance mode, this file is usually deleted. Oc­ca­sion­ally, however, an update is not correctly concluded. For example, this can happen if WordPress is ac­ci­dent­ally closed during the main­ten­ance 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­ten­ance Mode.

This problem can be easily fixed by manually deleting the .main­ten­ance file. The only pre­requis­ite 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­ten­ance 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­ten­ance file
  4. Update again, if needed

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

Go to Main Menu