How to enable and customize maintenance mode in WordPress

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:

Step 1: Log in to your account using
Step 2: Using the cPanel File Manager, go to the directory where you installed WordPress.
Step 3: Usually, WordPress is in the public_html directory, but it may be in a subdirectory beneath the public_html directory instead.
Step 4: Using your preferred text editor, create a file named .maintenance.
Step 5: Make sure the filename begins with a period (.) or this procedure will not work.
Step 6: Copy the following code and then paste it into the .maintenance file:

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

++++
Step 7: Save the changes to the .maintenance file.
Step 8: Maintenance mode is now active for the site. To restore normal site operation, delete the .maintenance file.

Related Articles