How to Enable WordPress Maintenance Mode in 6 Ways

How to Enable WordPress Maintenance Mode in 6 Ways

Constant website maintenance is essential to keep it functional and up-to-date. Whether it’s redesigning the site’s appearance or fixing a back-end issue, you may need to put your website in maintenance mode to avoid having a faulty website live. 

This article will show six different methods that can be used to put a WordPress website in under construction mode.

It will also explain how maintenance mode works and what you can do to ensure visitors will come back when your WordPress site is ready.

To enable WordPress Maintenance Mode, you can use a plugin or add a few lines of code to the website’s functions.php file. The plugin method is more user-friendly and allows customization of the maintenance page. The code method is recommended for experienced users who prefer a simple solution without additional plugins.

6 Ways to Put WordPress in Maintenance Mode

Activating WordPress under construction mode doesn’t have to be complicated.

While some methods require some code tweaking, WordPress maintenance mode plugins allow you do that with a few simple clicks. 

1. Using the hPanel Dashboard

Hostinger’s web hosting, cloud hosting, and WordPress hosting users can activate the maintenance mode from their hPanel.

First, log in to your hPanel account. Go to WordPress DashboardCore. Find the Maintenance Mode option and click on the slider to either activate or deactivate it. 

Maintenance mode on hPanel.

This method is easy to do as you don’t have to fiddle around with any WordPress plugins. 

However, there’s no way to customize the landing page so that website users will see only the default message.

Briefly unavailable message

2. Using the SeedProd Plugin – Recommended

SeedProd is a landing page builder plugin. It allows you to easily create landing pages for “Coming Soon” and “Maintenance” modes with its drag-and-drop builder.

This plugin has a free version and offers a premium plan, starting at $39.50/year

First, download and install the plugin. Once it’s activated, go to the plugin dashboard. 

You’ll see the modules to set up the “Coming Soon” and “Maintenance” pages and the buttons to activate them. At the bottom, there’s a section to manage your landing pages.

Seed Prod pages settings

To set up a maintenance mode page, go to SeedProd’s landing page templates library and click on a maintenance mode template you like. It will take you to the drag-and-drop builder, where you will be able to customize the template. Click Save to save the changes.

To add more landing pages, click Add New Landing Page button on the landing pages section. You can also rename the page title and URL on the Page Settings section of the builder.

Seed Prod general settings

When setting up the maintenance page, turn on the maintenance mode by clicking the Activate button on the plugin’s dashboard. You’ll see the message Maintenance Mode Active at the top right corner of your WordPress admin page when it’s activated.

Seed Prod page settings

3. Using the WP Maintenance Mode Plugin

WP Maintenance Mode plugin allows you to activate maintenance mode without touching a single line of code.

First, download and install the WP Maintenance Mode plugin. Once activated, select Settings WP Maintenance Mode from the WordPress dashboard.

On the Settings page, you will see five tabs – General, Design, Modules, Manage Bot, and GDPR. Let’s have a look at these tabs in more detail.

General

WordPress maintenance mode general settings

At the top, you will find the Status section. This is where you can activate or deactivate WordPress under construction mode.

If you activate the Bypass for Search Bots feature, search engines will be able to access your website during maintenance.

Lastly, Back end Role and Front end Role options allow you to choose which user roles can access the back-end while under maintenance mode. If you don’t set this, only the Administrator will be allowed to change this setting.

Design

WP maintenance mode design settings

This is where you create a splash page. To start building a splash page, go to the Title (HTML tag) section and add your title. Then, add the Heading and the Text to customize the maintenance message that will appear on the screen.

Once done, you can change the background color of the splash page. There’s also an option to use a custom background image to make the page more visually pleasing.

Modules

WP maintenance mode modules settings

Here you can configure the countdown timer by setting the starting and remaining time. Your clients will also get notified once your website is live again. 

The following section in the Modules tab is for connecting your social network accounts to the splash page. Insert your social media account link into the corresponding slot, and the plugin will then automatically show the social media icons on the maintenance page.

Manage Bot

WP Maintenance Mode Manage Bot settings

Create an interactive subscription form to attract new subscribers. In short, the idea is when a user gets into the maintenance mode screen, they can have a conversation with a bot. 

There are 10 customizable messages and four response options spread between them. You can collect the users’ names and email addresses using this method. 

To download the subscribers’ list, go to the Modules tab and select Export as CSV under the Subscribers.

Custome-made maintenance mode page

GDPR

WP Maintenance mode GDPR settings

In this tab, you get the settings for WordPress GDPR compliance. This is important to set up if you collect data from the subscription form on the splash page.

GDPR is a regulation ruled by the European Union (EU) that mandates businesses to protect users’ personal data and privacy. Failing to comply with this regulation leads to a hefty fine of 20 million or 4% of the company’s annual global turnover – whichever is greater.

While WordPress’s latest version complies with the GDPR, there are a few steps you need to take to ensure your website is fully compliant as well. 

First, you’ll need to activate the GDPR status located in this tab. Then, link the Privacy Page and create acceptance checkboxes for the contact form and subscribe form. If you haven’t set the Privacy Page, go to Settings Privacy to set one up.

Once the configuration for GDPR is complete, click Save settings, and your maintenance mode is ready for use.

4. Using the WP Maintenance Plugin

WP Maintenance is another WordPress under construction plugin that lets you customize the maintenance landing page for your site.

WP Maintenance Plugin dashboard

Once installed and activated, access the plugin’s settings from the left sidebar. There are nine sections available:

  • General. This is where you’ll find the button to enable maintenance mode and configure the landing page message.
  • Colors & Fonts. Customize the appearance of the landing page. Edit the background color, text color, and fonts to make them suit your branding. Keep in mind that there’s no drag-and-drop builder or visual editor, so you have to make these changes manually.
  • Pictures. Add a header image and a background image. In addition to that, you can add a pattern picture and a slider. 
  • Countdown. Enable countdown and set the launch date and time. There’s also an option to automatically disable the under construction mode at the end of the countdown to make your website live.
  • CSS Style. Contains the CSS sheet of the maintenance page. If you wish to customize the page by inserting custom CSS, do so here.
  • SEO. Settings for enabling SEO, editing the page’s meta title and meta description. You can also add a favicon from here.
  • Social Networks. Add social network accounts to the under construction landing page. This helps to direct users to your social media pages should they need more information. 
  • Footer. Enable the footer to the maintenance screen and customize the text. There’s also an option to add a link to the dashboard.
  • Settings. Contains additional settings, including enabling theme maintenance page, deleting custom settings upon plugin deactivation, and displaying server error codes.

5. Using a Custom Function

Important! This method requires editing the functions.php file. We strongly recommend making a backup of your WordPress site before proceeding.

  1. On your WordPress admin dashboard, go to Appearance Theme Editor. On the right side, there will be a list of theme files. Choose Theme Functions as this will open the functions.php file and allow you to edit the code in the editor.
WP Theme Functions settings
  1. At the end of the file add the following code:
// Activate WordPress Maintenance Mode

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’);

This will activate the default maintenance screen for WordPress. However, you can tweak the code to change the HTML message that will appear on the screen.

Within the fourth line of the code, find the wp_die function followed by the HTML code in the parentheses. Edit this HTML text to any message you want. For example, “The website is under scheduled maintenance. Please check back at 4pm EST.” 

Under Maintenance message
  1. Click Update File
  2. Once finished, remember to remove the code from the functions.php file to make the website live again.

6. Using the .htaccess File

Important! This method requires making changes to the .htaccess file. We recommend to backup your .htaccess file before proceeding. Also, note that you will not be able to access your WordPress dashboard by using this method as all requests will be redirected to the maintenance.html file.

  1. Locate the .htaccess file in your website’s directory. Log in to the Hostinger hPanel and go to the File Manager. Then, open the public_html directory.
  2. Create a maintenance.html file containing your under construction message. Or, upload the file if you have one already. This file will act as your maintenance screen.
  3. Find the .htaccess file in the public_html directory. Open the file by right-clicking and selecting Edit.
.htaccess file highlighted in the public_html folder

If you want to create a backup, copy the content of the .htaccess file and paste it into a new file named .htaccess_default. Then, add the following code snippet to the original .htaccess file content:

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_URI} !^/maintenance\.html$

RewriteRule ^(.*)$ https://example.com/maintenance.html [R=307,L]

Visitors will be redirected to the maintenance HTML page, and you can start working on the site.

What Is WordPress Maintenance Mode

WordPress maintenance mode is a status applied to a website when changes are being made that can potentially break it. 

Such minor tweaks, like updating or publishing content, can be done when your WordPress site is live. However, if you’re working on more significant changes, it’s best to take it offline to avoid poor impressions. 

When a site is in WordPress maintenance mode, the URL displays a screen with a message about your site’s state. The message usually explains why the website is offline and includes an estimation of when it will be live again.

WordPress maintenance mode works by using the function wp_maintenance and creating a .maintenance file that contains the message. After the construction process is complete, you can set WordPress to delete the maintenance file, and your website will work as usual.

Another use of WordPress maintenance mode is for preparing an upcoming website. By using a WordPress maintenance mode, you can create a Coming Soon screen. When users enter your URL, they will see information about the upcoming website and know when they should come back.

How Will Website Maintenance Affect Your Visitors

During maintenance, a WordPress site may not function properly or even appear broken. This can create a bad user experience, and visitors may doubt the website’s credibility or security, which can impact future traffic negatively.

WordPress offers a simple default maintenance mode and a splash page. However, it is just a plain HTML page with the text “Briefly unavailable for scheduled maintenance. Check back in a minute.” which looks rather dull.

Having a custom maintenance mode page provides a better user experience. It lets you customize your message and its overall design to suit your brand.

You can also shorten the WordPress maintenance time by creating a staging environment. It’s a separate copy of the website where you can work on changes without affecting the actual site. 

Once you’ve done working on the staged website, you’ll need to push the update to the actual website, and all changes will be applied automatically without any downtime.

Why Do You Need to Activate WordPress Maintenance Mode

Not all websites require a maintenance mode. Changes like managing content, fixing a minor bug, or updating blog content won’t affect your site’s overall functionality. Therefore, it’s safe to do them while the site is live.

However, more significant changes, such as configuring new plugins or customizing the themes, can affect the way your site functions. In such cases, it’s best to avoid the risk of crashing your site while it’s live and change it to under construction mode.

Here are a few other reasons why you would want to put a WordPress site in maintenance mode.

Avoid a Bad Impression

Having a broken or non-functional site can leave a lasting bad impression on your visitors. People may lose trust in the business’s legitimacy, which can negatively affect the traffic and conversion rates.

There are several under construction WordPress plugins that allow you to customize the maintenance page to suit your website design. This will not only let the customers know when the site will be back up, but it will also make the business look more professional and organized.

A landing page displaying an "Under maintenance" message

Minimize Security Risks

Another reason to use maintenance mode is to secure your WordPress site, especially while you’re working on fixing security issues. 

For example, if a malicious link is detected on your website, it’s best to take it offline until the issue is fully removed rather than risk visitor safety.

Create a Coming Soon Page

WordPress maintenance mode can be used to indicate or promote a site that’s under development. 

You can use the same WordPress under construction plugins to display a Coming Soon splash page while working on the site. Once the site is ready, simply turn off the maintenance mode and welcome the visitors to your new website.

Conclusion

There are several ways to put your WordPress site in maintenance mode and provide a temporary replacement page for your website. 

Whether it’s using a WordPress plugin, web hosting control panel, or tweaking a WordPress file, choose the one that suits your personal needs and technical skills.

Installing a WordPress plugin or using a hosting control panel, such as hPanel, are far more beginner-friendly options. If you’re not familiar with coding, we recommend picking one of the two methods. 

If you consider yourself to be relatively tech-savvy, go ahead and edit the code. After all, these methods provide the same result – a maintenance page for your visitors.

Remember that under construction mode is not only beneficial for maintenance purposes. The next time you plan to launch a website, you can use the maintenance mode for creating an appealing “Coming Soon” page too.

Author
The author

Leonardus Nugraha

Leo is a Content Specialist and WordPress contributor. Armed with his experience as a WordPress Release Co-Lead and Documentation Team Representative, he loves sharing his knowledge to help people build successful websites. Follow him on LinkedIn.