How to enable and customize Maintenance mode in WordPress

This article describes how to enable maintenance mode in WordPress, as well as how to customize the page that WordPress displays when it is in maintenance mode.

ENABLING MAINTENANCE MODE

By default, when WordPress is in maintenance mode visitors receive the following message:

Briefly unavailable for scheduled maintenance. Check back in a minute.

 

The most common maintenance mode scenario is when WordPress does an update. However, there may be times, such as during development or testing, when you want to manually enable maintenance mode. To do this, follow these steps:

  1. Log in to your account using cPanel or SSH.
  2. Using the cPanel File Manager, or at the command prompt, go to the directory where you installed WordPress.

    • Usually, WordPress is in the public_html directory, but it may be in a subdirectory beneath the public_html directory instead.

  3. Using your preferred text editor, create a file named .maintenance.


    Note: Make sure the filename begins with a period (.) or this procedure will not work.



  4. Copy the following code and then paste it into the .maintenance file:

    <?php

     $upgrading = time();

     ?>

  5. Save the changes to the .maintenance file.
  6. Maintenance mode is now active for the site. To restore normal site operation, delete the .maintenance file.

 
CUSTOMIZING THE MAINTENANCE MESSAGE

As discussed above, WordPress displays a default “Briefly unavailable for scheduled maintenance” message when it is in maintenance mode. However, you can customize the page that WordPress displays when it is in maintenance mode.

To do this, follow these steps:

  1. Using SSH or the cPanel File Manager, navigate to the wp-content subdirectory in the directory where you installed WordPress.
  2. Using your preferred text editor, create a file named maintenance.php.
  3. In the maintenance.php file, add the HTML or PHP code that you want to use when WordPress is in maintenance mode. WordPress will use the maintenance.php file instead of displaying the default message.
  • WordPress
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Add MailChimp Subscribers from WordPress

You can add subscribers directly to a MailChimp mailing list from WordPress. This article...

Broken Image Links in WordPress

This articles describes how to resolve a problem that may occur when you try to add images to a...

How to Add CAPTCHA Protection to a WordPress Site

This article describes how to add CAPTCHA protection to a WordPress site using the Google CAPTCHA...

How to Add External RSS Feeds to your WordPress Site

This article demonstrates how to add an external RSS feed to a WordPress site. RSS (Rich Site...

How to Add a Custom Logo to WordPress

This article describes how to add a custom logo to a WordPress site. Adding a logo to your...

Powered by WHMCompleteSolution