If you need to update your WordPress website, perform maintenance or make any other changes that require some downtime, placing your website in maintenance mode is a good option. Doing so will ensure that visitors don’t encounter any errors or issues while you make changes to your site.
There are several ways to put your WordPress site into maintenance mode. In this post, we’ll explore some of the most common methods.
- Use a maintenance mode plugin: One of the easiest ways to put your WordPress site into maintenance mode is by using a maintenance mode plugin. There are several options available in the WordPress plugin repository, such as WP Maintenance Mode, Maintenance, and Coming Soon Page & Maintenance Mode by SeedProd. These plugins offer a range of features and customization options, such as countdown timers, custom branding, and contact forms.
To use a maintenance mode plugin, simply install and activate it on your WordPress site. Then, navigate to the plugin’s settings page and enable maintenance mode. You can customize the look and feel of your maintenance page by selecting a pre-designed theme or creating your own.
- Use a maintenance mode code snippet: If you prefer not to use a plugin, you can put your WordPress site into maintenance mode by adding a code snippet to your website’s functions.php file. This method requires some technical know-how, so it’s best to proceed with caution.
To add a maintenance mode code snippet, first, create a new file on your computer using a text editor. Then, add the following code to the file:
<?php
function wp_maintenance_mode() {
if ( !current_user_can( 'edit_themes' ) || !is_user_logged_in() ) {
wp_die('Maintenance mode is on. Please check back soon!');
}
}
add_action('get_header', 'wp_maintenance_mode');
?>
Save the file as maintenance.php and upload it to your WordPress site’s wp-content folder. Then, add the following line of code to your website’s functions.php file:
include_once('wp-content/maintenance.php');
This will activate maintenance mode on your WordPress site. To deactivate maintenance mode, simply remove the line of code you added to your functions.php file.
- Use a coming soon page plugin: Another option for putting your WordPress site into maintenance mode is by using a coming soon page plugin. This type of plugin is specifically designed to display a landing page that promotes your website’s launch, while it’s still under construction.
Like maintenance mode plugins, there are several coming soon page plugins available in the WordPress plugin repository. Some of the most popular options include SeedProd’s Coming Soon Page & Maintenance Mode, Under Construction Page, and Coming Soon & Maintenance Mode by Colorlib.
To use a coming soon page plugin, simply install and activate it on your WordPress site. Then, navigate to the plugin’s settings page and enable the coming soon page. You can customize the look and feel of your coming soon page by selecting a pre-designed theme or creating your own.
Regardless of the method you choose, placing your WordPress site into maintenance mode is an important step in ensuring that your visitors have a smooth and error-free experience on your website. By following the steps outlined in this post, you can put your site into maintenance mode with ease and minimal disruption to your visitors.