You can enable maintenance mode in WordPress Hostinger by using a plugin or by manually editing your website's files.
Using a Plugin
- Install and activate a maintenance mode plugin. Popular options include:
- Coming Soon & Maintenance Mode: https://wordpress.org/plugins/coming-soon-maintenance-mode/
- WP Maintenance Mode: https://wordpress.org/plugins/wp-maintenance-mode/
- Maintenance: https://wordpress.org/plugins/maintenance/
- 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
-
Create a new file named maintenance.php in your WordPress root directory.
-
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; ?>
-
Save the file.
-
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.