4. In the root folder of your WordPress installation, click New File.
5. Name the file .maintenance, making sure to include the dot (.) at the beginning.
9. The file opens in the File Manager editor. Add the following lines to the file:
<?php $upgrading = time(); ?>
Disabling manual maintenance mode
When you’re finished updating your site and want to disable manual maintenance mode, you can delete the .maintenance file. However, if you think you might put your site in maintenance mode in the future, you may want to rename the file instead of deleting it. This way, the next time you want to enable maintenance mode, you can rename it to .maintenance instead of creating a new file.
- Right-click the .maintenance file and select Rename.
- Name the file any descriptive name you want and click Rename File. In this example, we’re calling it .maintenance-disabled.
Your site is now displayed normally to visitors.
Customizing the maintenance mode message
Follow these steps to customize the message site visitors see when the site is in maintenance mode.
- Log in to your HostPapa Dashboard.
- Click My cPanel.
- In the Files section, click File Manager.
4. In the root folder of your WordPress installation, open the wp-content subfolder.
5. Click New File.
6. Name the file maintenance.php and click Create New File.
7. Right-click the maintenance.php file and click Edit.
8. Add the HTML or PHP code you want to use to display the maintenance mode message and click Save Changes. In this example, we’re creating a simple message with text and an image.
« Show WordPress Login Form Anywhere Without a Plugin
<html> <head><title>Offline for maintenance</title></head> <body> <h2 style="text-align: center;">Sorry, we're currently offline for scheduled maintenance. We'll be back soon!</h2> <p style="text-align: center;"><img src="https://example.com/wp/wp-content/uploads/2018/01/clouds.jpg" width="600" height="400" /></p> </body> </html>
How to add File Size admin column in WordPress Media Library »