Get 69% Off on Cloud Hosting : Claim Your Offer Now!
Turning on maintenance mode in WordPress comes in handy when your site needs updates, big tweaks, or problem-solving, without bothering your site's users. In this mode, visitors see a personal message telling them the site isn't available right now. Here is your guide to switch on maintenance mode in WordPress.
One of the easiest ways to enable maintenance mode is by using a WordPress plugin. There are several plugins designed for this purpose.
1. Log in to your WordPress admin dashboard.
2. Go to Plugins > Add New.
3. In the search bar, type "Maintenance Mode" or "WP Maintenance Mode."
4. Install and activate the WP Maintenance Mode plugin or any maintenance plugin of your preference.
1. After activating the plugin, go to Settings > WP Maintenance Mode (or the plugin’s specific menu).
2. In the General tab, turn on the Enable Maintenance Mode option.
3. Customize the message or template shown to visitors while your site is in maintenance mode. You can usually add custom text, logos, or even a countdown timer.
4. Click Save Settings to activate maintenance mode.
Check your site using a private or hidden web window. Do this to make sure visitors see your website's under-construction note as they should.
One way to turn on maintenance mode manually is by altering your theme's functions.php file. This strategy works perfectly if you'd rather not add a plugin.
1. Log in to your WordPress dashboard and go to Appearance > Theme File Editor.
2. Select the functions.php file from the right-hand sidebar.
3. Add the following code snippet to the bottom of the functions.php file:
php
Copy code
function wp_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die(' We are currently performing scheduled maintenance. Please check back later.Under Maintenance
}
}
add_action('get_header', 'wp_maintenance_mode');
Save the changes.
To make sure visitors see the "Under Maintenance" message, open your website in an incognito window or log out of your admin account.
Once you’re done with your changes, simply remove the code snippet from your functions.php file to disable maintenance mode.
WordPress automatically enters maintenance mode during core updates. If the update process is interrupted, your site may get stuck in maintenance mode. To manually disable or re-enable it:
1. Use an FTP client (like FileZilla) or the file manager in your hosting control panel to access your WordPress installation files.
1. In the root directory of your WordPress installation (the same folder containing wp-config.php), look for a file named .maintenance.
2. To enable maintenance mode, create this file and add the following code:
php
Copy code
$upgrading = time();
To disable maintenance mode, simply delete the .maintenance file.
Enabling maintenance mode in WordPress helps ensure that your visitors are informed when your site is temporarily unavailable due to updates or changes. Using plugins or manual methods, you can easily control when your site enters and exits maintenance mode. Always remember to disable maintenance mode after completing your updates.
Let’s talk about the future, and make it happen!
By continuing to use and navigate this website, you are agreeing to the use of cookies.
Find out more