How to Enable Maintenance Mode on WooCommerce Store – Easy Guide

WooCommerce Maintenance Mode

Did you know that you can put your WooCommerce store in maintenance mode? But why would you do that? There are many times when your site is not functioning properly, or is in the middle of an upgrade, or is facing some security issues. At this point, you don’t want your customers experiencing an ill-functioning or incomplete site. Thus, you can easily enable WooCommerce maintenance mode. 

Maintenance mode refers to the state when a splash screen appears on a certain page or the whole website in case of any maintenance, so customers are aware that some work is being carried out and they can explore the site later.

In this article, we will cover the many reasons why to put your site on maintenance mode and how. Let’s get started!

Related Article: WooCommerce vs Shopify Dropshipping – Which One Should You Go For?

Why Do You Need WooCommerce Maintenance Mode

Why do you need WooCommerce maintenance mode
Repairman for maintenance or improvement. Vector Illustration

1. Security Issue

An online site will always be the target of security bugs and malware, thus instead of fixing the issue while the website is still working, it is better to enable maintenance mode so customers don’t lose valuable information or get redirected to phishing sites. Faulty plugins and themes can cause performance issues or malware can log in to the admin account to steal confidential information. Thus, by shutting down the shop page, you can fix the security issues and also keep your customers informed.


2. Under Construction

If you are opening a new eCommerce site and want to see how it looks in real-time or it still isn’t completed, the best course of action is to put it on maintenance mode with a “coming soon” splash page. This is beneficial as your customers won’t be confused and it gives you plenty of opportunities to see how your site looks or if it requires any changes. The coming soon page will also create a sense of excitement among your audience


3. Re-designing

It is good to give your website an upgrade after a while to keep your customers interested. But it is essential to put your WooCommerce site on maintenance mode while doing so, as to not confuse your customers into leaving by an uncompleted site. A splash page will explain to your customers about the work being done and you can also be in contact with them by adding an email address.

Let’s see how you can enable maintenance mode on your WooCommerce shop page or overall site. 

Check out our compilation of the best WooCommerce Affiliate Plugins here.

How to Enable Maintenance Mode for WooCommerce

how to enable

If you are wondering how to enable maintenance mode for WooCommerce, then there are 3 other methods available rather than using a plugin. Such as using a custom code, using the built-in feature on WordPress, or editing the .htaccess file. Let’s discuss these methods in detail.

1. Creating a Custom Code

Instead of using a WooCommerce plugin, you can add a code snippet to show a maintenance mode splash page on your website. The code to be used is:

// 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 />Something ain’t right, but we’re working on it! Check back later.’);

    }

}

add_action(‘get_header’, ‘wp_maintenance_mode’);

You can customize the message however you like.  


2. Built-In WordPress Feature

Based on the type of maintenance being carried out on your site, you can simply use the built-in WordPress feature to put your WooCommerce site on maintenance mode when your site is on update. During an update, WordPress shows your site has entered maintenance mode and becomes deactivated once the update is finished. But this is only useful for updates, not for security issues or redesigning. 


3. Edit the .htaccess File

If you don’t want to lose potential customers and sales, you can simply edit the .htaccess file which is found in your root directory, by adding the code:

RewriteEngine On

RewriteBase /

RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.123

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

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

By adding this code, any customers who visit your site will be redirected to a temporary homepage or shop page where they can connect with you. Many HTML templates are also available to choose from. 


4. Using a Plugin

If you want to stay in contact with your customers even during maintenance and fixing bugs, a better option is to use plugins instead of just changing the code. A plugin will put your WooCommerce site on maintenance mode along with other features such as customizing the page, adding social share links, and adding an email address. It is also easier than editing code and automates the whole process. 

Some of the popular WooCommerce maintenance mode plugins are Maintenance Mode by SeedProd, WP Maintenance Mode, etc. 

Related Article: 5 Reasons Why WooCommerce is a Leading eCommerce Platform

Final Words

I hope this article cleared up any confusion regarding what is maintenance mode and how to enable it on WooCommerce. By using maintenance mode for WooCommerce, you can keep in contact with your customers even when your site is offline or under construction. This will help in improving the customer experience and also show professionalism. Make sure to check your site from a visitor’s view to see if it is enabled and what pages are still functional, etc.