# Enabling and customising maintenance mode in WordPress

> Take your WordPress site offline temporarily with a custom maintenance mode message while you make updates.

Source: https://helpcenter.ruachost.com/wordpress/guides/enabling-and-customizing-maintenance-mode-in-wordpress/

Maintenance mode allows you to temporarily take your WordPress site offline while performing updates, testing, or development work. Visitors will see a maintenance message instead of your live site. On **ruachost.com**, you can enable and customize maintenance mode easily.

## Why Use Maintenance Mode?

- Prevents visitors from seeing incomplete or broken updates.
- Provides a professional message instead of errors.
- Useful during plugin/theme updates, migrations, or testing.

## Enabling Maintenance Mode Manually

1. **Log in to your hosting account** via **cPanel** or SSH.
2. Navigate to the directory where WordPress is installed (usually `public_html`).
3. Create a file named `.maintenance` using a text editor.
4. Add the following code:

   ```
   <?php $upgrading = time(); ?>
   ```
5. Save the file.
6. WordPress will now display the default maintenance message:

   ```
   Briefly unavailable for scheduled maintenance. Check back in a minute.
   ```

✅ To restore normal site operation, simply delete the `.maintenance` file.

## Customizing the Maintenance Mode Message

1. Navigate to the `wp-content` directory of your WordPress installation.
2. Create a file named `maintenance.php`.
3. Add your custom HTML/PHP code to design the page. Example:

   ```
   <!DOCTYPE html>
   <html>
   <head>
     <title>Site Under Maintenance</title>
     <style>
       body { text-align: center; font-family: Arial; padding: 50px; }
       h1 { color: #333; }
     </style>
   </head>
   <body>
     <h1>We’ll be back soon!</h1>
     <p>Our site is currently undergoing scheduled maintenance. Please check back later.</p>
   </body>
   </html>
   ```
4. Save the file.
5. WordPress will use `maintenance.php` instead of the default message whenever maintenance mode is active.

> **Note:**
- The `.maintenance` file must begin with a **period (.)** or it will not work.
- Always delete the `.maintenance` file after updates to bring your site back online.
- Customizing `maintenance.php` allows you to add branding, logos, or even countdown timers.
