Wouldn’t it be great if you could create a custom message in your maintenance file for whenever your website is undergoing an upgrade or touch-up without the need of extra plugins? It might come in handy.
WARNING: This is process requires some advanced knowledge of WordPress and Hosting environments.
Okay, so hear me out…it’s not that needed, but it can make things look neat. You are basically allowing your visitors to see a message that could make them feel at ease instead of the generic message:
When you’re finished updating your site and want to disable manual maintenance mode, you can delete the
.maintenance file (If WordPress hasn’t done that already). However, if you think you might put your site in maintenance mode in the future, you may want to rename and use the file instead of deleting it.
For example, you can rename it to
.maintenance-disabled. This way you, for next time, when you want to enable maintenance mode, you can rename it to
.maintenance instead of creating a new file.
Here are the steps to do that:Right-click on the
.maintenance file and choose ‘Rename’.
Name the file any descriptive name you want and click Rename File. In this example, you can call it as
This will allow your site to be shown to your visitors again.
But what about the personal message when we want to do maintenance on our site? Here are the steps:
- Log in to your hosting Dashboard.
- Click on your cPanel or Plesk or whatever you are using — I’m using cPanel as an example here.
- 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. For this example, you can create a simple message with text and an image by using the following code:
<html> <head><title>Offline for maintenance</title></head> <body> <h2 style="text-align: center;">Sorry, we are currently offline for scheduled maintenance. We will be back soon!</h2> <p style="text-align: center;"><img src="https://example.com/wp/wp-content/uploads/2021/01/picture.jpg" width="1000" height="800" /></p> </body> </html>
Make sure to change the ‘img src’ link to a picture link from your WordPress website and you should be all set. If you have the knowledge of PHP and HTML, you can add and customize this message to your liking.
The next time your site is in maintenance mode, maintenance.php is displayed with its custom message instead of the default message.
- Don’t delete the .maintenance file from your WordPress root directory.
- Rename the .maintenance file to something else so that it is disabled.
- Create a maintenance.php file and add it to your server.
- Activate the .maintenance file and the php file will show the custom message.
If your .maintenance file is deleted, just add a new one and make sure that the ‘hidden files’ are shown on the server. Then inside the .maintenance file, just add this code:
<?php $upgrading = time(); ?>
This is a manual method of maintenance control for your WordPress site. However, if this helped you, let me know in the comments below.