WordPress offers a maintenance mode which, when you perform updates, notifies users visiting your website of the temporary interruption. While this function is very practical, sometimes, due to incorrect handling, your WordPress remains stuck in maintenance modeIn this article, you will find our tips on how to properly activate WordPress maintenance mode and how to unlock it in case of malfunction.
Why put your WordPress site in maintenance mode?
Maintenance mode offers several advantages when performing updates on WordPress.
- It informs the user that the site is temporarily undergoing maintenance.
- He reassured visitors, informing them that the site was not damaged and would soon be accessible again.
- It provides precise information on the duration of the maintenance.
- He takes care of the website's communication
- It allows us to stay in touch with visitors
Maintenance mode: how does it work?
With WordPress, you can make updates to your website without having to activate maintenance mode yourself: the platform introduced in its version 3.0 a feature that automatically sends the user a message notifying them of an operation in progress on the page.
The message automatically sent by the platform is as follows: “Briefly unavailable for scheduled maintenance. Check back in a minute »The visitor will see this message when you perform an update, or when you do a new installation from the dashboard.
As you can see, this maintenance mode Automatic translation delivers a generic, unengaging message to your visitors. It's even possible that the reader won't bother to translate it and will assume your site is no longer operational.
To make your message more effective and relevant, it's advisable to manually modify WordPress's maintenance mode. This will allow you to:
- Adding personalized phrases to warn the user
- To send more user-friendly notifications
- To suggest alternative links to visit while waiting for the site to reopen
- To provide a precise timeframe for maintenance operations
Why customize WordPress maintenance mode?
In general, creating a custom maintenance page offers several advantages for the development of your website:
- Offer a better user experience to your internet users
- Bringing new information to your readers
- Improve the image of your website
- Strengthen the connection with visitors
How do I put my WordPress site into maintenance mode?
You have two options for activate maintenance mode yourself and personalize your page.
Manual activation without plugin
It is possible to manually enter maintenance mode. However, this requires some coding knowledge. Furthermore, this operation must be performed before any new installation. WordPress update.
- Find the file
.maintenancelocated in the WordPress root directory - Once you have found it, insert the following code into the file:
<?php $upgrading = time(); ?> - Delete the file when you have finished the maintenance.
You can also manually activate maintenance mode by following these steps:
- Use the file
functions.phpintended to add features - Insert PHP code similar to this into the file:
<?php function maintenance_mode() { if ( !current_user_can( 'administrator' ) ) { wp_die('Maintenance.'); } } add_action('get_header', 'maintenance_mode'); ?> - Add a custom sentence to describe the maintenance operation (you can also include images)
Activation with plugin
The easiest way to activate a personalized maintenance world The solution is to install a specific plugin. Two WordPress extensions are particularly easy to use and offer a wide range of customization options:
The Maintenance plugin
This is undoubtedly the most downloaded maintenance plugin by WordPress users. Completely free, it allows you to customize the text and page layout to your liking (color, design, background). Several other features are available with the extension, such as installing a countdown timer or links, or subscribing users to the site's newsletter.
The Coming Soon Page & Maintenance Mode plugin by SeedProd
This plugin, launched in 2011, is also very useful for customizing a maintenance mode on WordPress. Available in free or paid versions (depending on the chosen plan), it has the advantage of working with all WP themes, being responsive – compatible with all devices (computer, smartphone, tablet) – and enabling multisite functionality.
Several other maintenance plugins are available for WordPress. Choose the one that best meets your needs!
How to fix a WordPress site stuck in maintenance mode?
WordPress frequently gets stuck in maintenance mode. You can no longer log in to your site, and visitors consistently see a message informing them of ongoing maintenance. Several reasons can cause this malfunction:
- WordPress accidentally closed during the maintenance process
- The plugin update was interrupted during loading.
- An incorrect plugin update was performed
Whatever the problem, if WordPress is stuck in maintenance modeThis means that the temporary maintenance file ".maintenance" (created in the main folder by the platform at the start of the operation) has not been deleted. Don't panic! This is a relatively common problem that you can easily solve: simply delete the file manually. .maintenance by following these steps:
- Access the web server using an FTP program.
- Enter the WordPress root directory
- Delete the .maintenance file
- Perform a new update if necessary
Also, remember to clear your cache from the toolbar in your dashboard. Your site should then function normally again. Find all our tips on our blog or contact our experts to receive assistance with installation or unlocking maintenance mode of your WordPress site !