A2oz

How Do I Enable Maintenance Mode in WordPress Hostinger?

Published in WordPress 1 min read

You can enable maintenance mode in WordPress Hostinger by using a plugin or by manually editing your website's files.

Using a Plugin

  1. Install and activate a maintenance mode plugin. Popular options include:
  2. Configure the plugin settings. This typically involves setting a custom message, choosing a theme, and deciding when to display the maintenance mode.

Manually Editing Files

  1. Create a new file named maintenance.php in your WordPress root directory.

  2. Add the following code to the file:

     <?php
     // Start output buffering
     ob_start();
    
     // Define the maintenance message
     $maintenance_message = "Our website is currently under maintenance. We'll be back soon!";
    
     // Display the maintenance message
     echo "<!DOCTYPE html>
     <html>
     <head>
     <title>Maintenance Mode</title>
     </head>
     <body>
     <h1>" . $maintenance_message . "</h1>
     </body>
     </html>";
    
     // End output buffering
     ob_end_flush();
    
     // Exit the script
     exit;
     ?>
  3. Save the file.

  4. Enable maintenance mode by accessing your website's files via FTP or your hosting control panel.

Note: You may need to adjust the code to customize the maintenance message and style.

Related Articles