How to Put Your WordPress Site in Maintenance Mode

Read our Advertiser Disclosure.
Contributor, Benzinga
September 20, 2021

Whenever you make significant changes to your website, the best practice is to do it behind a maintenance screen to ensure your changes do not hamper the user experience. WordPress sites let you access the maintenance mode in a few simple steps. Learn how to activate maintenance mode on your WordPress site using either code, themes or plugins now.

What Is WordPress Maintenance Mode?

Whenever you need to make a sizable upgrade on your site, it can be unavailable to visitors for a certain period. Activating the WordPress maintenance mode on your site is an excellent way to inform your visitors about the ongoing maintenance work yet keep them engaged during the updates.

Maintenance mode is also an excellent practice as it shows a user-friendly notification and provides alternative links a visitor can use if a link is not working. 

Steps To Put your Website in WordPress Maintenance Mode

When upgrading your website, you might have to take down your live site and replace it with a maintenance mode page for a period. Here is how you can change WordPress to maintenance mode in three different ways.

Using a Plugin

When your website requires more extensive upgrades or maintenance that causes larger downtime, you may want to display additional information like contact info, alternative links or contact forms instead of plain text. You can do so easily by using a plugin.

Step 1: Choose a WordPress maintenance plugin

To enable maintenance mode using a plugin, you'll need to add a maintenance plugin. To add a new plugin:

  1. Login to WordPress Dashboard.
  2. Navigate to Plugin from the left sidebar.
  3. Click on Add New option.
  4. Search for maintenance mode Plugins using the search bar.
  5. Choose the best plugin to create a custom post type.
  6. Click on the Install Now button to begin the installation.

Some of the most popular free maintenance mode plugins are Coming Soon by SeedProd, Under Construction by Web Factory and Maintenance by WP Maintenance. 

Step 2: Create a maintenance mode page

Many plugins offer templates to create a maintenance page in your WordPress site within minutes. Choose a template for your maintenance page, then activate it. 

Step 3: Customize your maintenance mode page

While maintenance mode pages are usually minimal, you can always customize them if needed. Depending on the plugin of your choice, you can add your elements to the page to make it more engaging. Using a plugin, you might be able to customize the following details:

  • Title of the page
  • Meta description of the page
  • The headline of the page
  • The body of the page to include relevant video, images or text
  • Social media handles.
  • Contact forms
  • Pop-ups

Step 4: Preview and activate

Before going live with any page, it is a good practice to preview it. WordPress lets you preview the maintenance mode page using the Preview button. If the page meets your needs, you can activate it by setting the toggle button on the maintenance mode plugin dashboard to Active or On. To deactivate maintenance mode, you can toggle the maintenance mode button to Off or Inactive.

Using a theme or page builder

You can also use theme builders to set WordPress to maintenance mode. While there are numerous page builders in the market, this article will focus on Elementor. You can activate maintenance mode in Elementor by following the steps below:

Step 1: Find the maintenance mode settings.

You can access the Maintenance mode in Elementor from the Tools menu of the plugin. It lets you choose between Coming Soon mode and Maintenance mode and sends out the proper status codes to search engines. The Coming Soon mode is best for new websites under construction, while the Maintenance Mode is best for existing websites undergoing maintenance.

Step 2: Create and design your maintenance mode page templates

The first step to using maintenance mode pages is to create them. To create a maintenance mode page, click on the Create One button, input a name and publish the page. After publishing, click on the Edit with Elementor button to add or remove components from the page. You can easily hide the page's title by setting the Hide Title button to Yes and Page Layout to Elementor Canvas.

Step 3: Activate your maintenance mode page

You can preview the maintenance mode page to ensure that the page has all the necessary links and elements. To activate the page, go to Maintenance Mode through the Tools submenu of the Elementor menu and click the Choose Template option. Next, select the template you created in the previous step and click Save Changes. To deactivate maintenance mode, go to Maintenance Mode in the Tools submenu and choose Disable Maintenance Mode setting. 

Using a Code

The easiest way to activate WordPress maintenance mode is via code. However, the following steps require you to edit the functions.php file, one of the core WordPress files, so back up your website before continuing further. To activate maintenance mode via code, follow the steps below:

Step 1: Go to WordPress Theme Editor

Go to the Theme Editor on your WordPress site from the Theme Editor submenu through the Appearance menu on the sidebar.

Step 2: Access the functions.php file

Click on the functions.php file and open it in the code editor.

Step 3: Add WordPress maintenance mode code

Add the following snippet to the file. 

function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Under Maintenance</h1><br />Website under planned maintenance. Please check back later.');
}
}
add_action('get_header', 'wp_maintenance_mode');

The above snippet is enabling a message your visitors will see when the website is undergoing maintenance. The message is set via the parameters of the wp_die function. To change the message, update wp_die parameter.

Step 4: Update and confirm

Click on Update File to activate maintenance mode. To deactivate the maintenance mode, remove the snippet from the functions.php file. 

Activate WordPress Maintenance Mode Now

Putting your WordPress site in maintenance mode is a simple yet engaging way to notify your visitors of ongoing website maintenance. The simplest yet most technical way to enable maintenance mode is via code. However, if you are not great with code, you can use either plugins or theme builders. 

Whatever method you use, maintenance mode is the most efficient way to keep your visitors engaged and prevent any confusion they may face during the maintenance period. So, if you have to update or upgrade your website, start using maintenance mode now.