Enabling and customising maintenance mode in WordPress
Ce contenu n’est pas encore disponible dans votre langue.
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?
Section titled “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
Section titled “Enabling Maintenance Mode Manually”-
Log in to your hosting account via cPanel or SSH.
-
Navigate to the directory where WordPress is installed (usually
public_html). -
Create a file named
.maintenanceusing a text editor. -
Add the following code:
<?php $upgrading = time(); ?> -
Save the file.
-
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
Section titled “Customizing the Maintenance Mode Message”-
Navigate to the
wp-contentdirectory of your WordPress installation. -
Create a file named
maintenance.php. -
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> -
Save the file.
-
WordPress will use
maintenance.phpinstead of the default message whenever maintenance mode is active.
Cette page vous a-t-elle aidé ?
Merci pour votre retour.