Enabling WordPress maintenance mode
By default, when WordPress is in maintenance mode visitors receive the following message:- Log in to your account using cPanel or SSH.
-
Using the cPanel File Manager, or at the command prompt, go to the directory where you installed WordPress.
📘 Note Usually, WordPress is in the public_html directory, but it may be in a subdirectory beneath the public_html directory instead.
-
Using your preferred text editor, create a file named .maintenance.
🚧 Important Make sure the filename begins with a period (.) or this procedure will not work.
- Copy the following code and then paste it into the .maintenance file:
- Save the changes to the .maintenance file.
- Maintenance mode is now active for the site. To restore normal site operation, delete the .maintenance file.
Customizing the WordPress maintenance mode 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:- Using SSH or the cPanel File Manager, navigate to the wp-content subdirectory in the directory where you installed WordPress.
- Using your preferred text editor, create a file named maintenance.php.
- 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.