Method 1:
- In the root folder of your WordPress installation, click New File.
- Name the file .maintenance, making sure to include the dot (.) at the beginning.
- Right-click the .maintenance file and select Edit.
- If you can’t see the .maintenance file, click Settings in the upper right corner and ensure that Show hidden files (dotfiles) is selected.
- The file opens in the File Manager editor. Add the following lines to the file:
<?php
$upgrading = time();
?>
Your site will be in maintenance mode as soon as you save the file. Click Save Changes. The site now displays the default maintenance mode message.

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.
- In the root folder of your WordPress installation, open the wp-content subfolder.
- Click New File.
- Name the file maintenance.php and click Create New File.
- Right-click the maintenance.php file and click Edit.
- 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.
<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>
Method 2:
For short-term downtime (less than an hour or so), you might not want to go through the trouble of setting up a custom maintenance mode page.
In that case, you can use WordPress’s default maintenance mode page to let visitors know you’ll be right back.
Open the functions.php File
Look for the file called Theme Functions or functions.php. With functions.php open in the editor, copy all of the code inside the file and save a copy of it to your desktop. Then, scroll to the bottom of the file and add the following snippet:
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Under Maintenance</h1><br />Website under planned maintenance. Please check back later.');
}
}
add_action('get_header', 'wp_maintenance_mode');
This is the default WordPress maintenance mode setting and message. If you want to edit what it says, replace this bit with your own wording.
As a logged-in user, you won’t be able to see maintenance mode when you visit the website. That’s so you can keep working and previewing your changes.
You want to make sure it’s been activated though.
To do this, you can either log out of WordPress and visit the website or you can open it in a completely new browser.
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Fatal Error</h1><br />allowed memory size of 67108864 bytes exhausted.');
}
}
add_action('get_header', 'wp_maintenance_mode');