There was a problem loading the comments.

How to Put Your WordPress Website into Maintenance Mode in DirectAdmin

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Follow these steps to put your WordPress website into maintenance mode in DirectAdmin:

 

1. Log in to your DirectAdmin account.
For instructions on how to log in to your DirectAdmin account, please click here.

93fa78453a69c8622e20602c56d427ffbc75b0d076fae439ca797766e8b0a04e417dcdf46c774d2d?t=edf763a81977cd2c9a4f74c2f4d2f115


2. Under System Info & Files, click File Manager.

e82d0878c293721e7e78d98330897e8e784d654a689bf7151e75ada2ec576762b70dd64a1218cbed?t=e4f64a280f77d062c607edea9851397f


3. Go to the directory of your WordPress installation (most commonly under public_html). Whilst in the directory of your WordPress installation directory, create a file called “.maintenance “.

To do this, click the Create text file icon on the left.

50457b01f5e728eb14d842399849a70302dbbe469f88c98bff1f1c52d9038e4b3a8fea5cdce6827f?t=656920d301aca8da939995d6740763be

 

4. From the options provided, click Plain Text.

cd1da266c79f72f595475e1d029e05fa68bf3b35da226ed7b0380650490be7142a4cdb50f0781b6c?t=5d8ed73bc611374873d6b790729ce744

 

5. Name the file .maintenance.

dd8b51781906b5d11d7057687928deb17ea68ebeb8f6fb241d6a849a7c735b282fb2739a46a228de?t=9932a67ca02a9e5917fee6633eda8358

 

6. Once created, right-click the .maintenance file, then click Edit.

6bdf5ce7dac679d164a99099ecff70043eda78bf386bd2f63629aef9cd72431473bad065e8a47202?t=4123787c7247dcdf052324a39201d65c

 

7. Paste the following code into the file and click the Save button.

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


8. Once saved, this will put your website into maintenance mode. Anyone visiting the page will see the message below:

3cf9412d89376999187fef2c171ab221a79c7ee9949718227df95ddf70a527f4a5259a46f96c082a?t=ce9c66e503f68dcf20eec5bed7184b91

 

 

Optional

 

9. If you wish to customise this message, return to File Manager. Go to the directory of your WordPress installation (most commonly under public_html), then double-click on the wp-content folder.

Create a new file called "maintenance.php" in the wp-content folder.

98a2aa98b3902b0d5509a27d9f323511d095ac1c33e0539a66c857c2c2b1aa437c14534a00347d3c?t=48a3bd79c95b9e442e11fc3bb5b1f239

 

10. You can edit this file and add HTML/CSS/XML coding to display your customised maintenance page.

 

For example, the following code:

<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-content/uploads/2021/12/clouds.jpg" width="900" height="700" /></p>
</body>
</html>

 

Will display the following maintenance page:

74a7589f350e45c78d1e1f7201d01b2c241318793bf82260fa6c30799b28f19e93db81d7bcd79b95?t=8b9405626c5d836f989eed4492e7f958

 

Note: This code is just an example and will not display the customised maintenance page above if copied and pasted, as you will need to make adjustments to the code and reference an actual image within your file manager.


Share via
Did you find this article useful?  

Related Articles

Tags

© DreamIT Host