Most people want to get as many visitors to their website as possible.However, there are legitimate reasons you might want to temporarily limit access to your store.
Perhaps you’re still building your site and don’t want visitors seeing incomplete pages. Or maybe your website is facing security threats from malware or malicious users. If you’re experiencing any of these challenges, implementing maintenance mode or a “Coming Soon” page can provide peace of mind while you address the issues.
In this article, we’ll briefly explain what maintenance mode is for a WooCommerce store and then we’ll show you how you can apply this to your website.
How to activate maintenance mode for your WooCommerce store
There are multiple ways to put your store into maintenance mode or close it temporarily. You can either manually add code to the functions.php file or use a plugin designed to make this process easier.
Add Code to Functions.php Manually
To manually add code to your functions.php file to put your WooCommerce store into maintenance mode, run through these steps:
- First, back up your site before making any changes to core files
- Access your functions.php file through your theme folder (via FTP or your hosting file manager)
- Add this code snippet to the end of your functions.php file:
// WooCommerce Maintenance Mode
function wc_maintenance_mode() {
// Check if user is logged in and has admin capabilities
if (!is_user_logged_in() && !current_user_can('administrator')) {
// If the current page is a WooCommerce page or product
if (is_woocommerce() || is_product() || is_cart() || is_checkout() || is_account_page()) {
// Custom maintenance message
$maintenance_message = '<h1>Store Maintenance</h1>';
$maintenance_message .= '<p>Our store is currently undergoing scheduled maintenance. We\'ll be back shortly!</p>';
$maintenance_message .= '<p>Please check back later.</p>';
// Display the maintenance message and exit
wp_die($maintenance_message, 'Maintenance Mode', array('response' => 503));
}
}
}
add_action('template_redirect', 'wc_maintenance_mode');
You can customize the maintenance message by modifying the HTML within the $maintenance_message variable.
To disable maintenance mode when you’re ready to reopen your store, simply remove this code from your functions.php file or comment it out by adding /* before the code and */ after it.
This approach will only affect WooCommerce pages (shop, products, cart, checkout, account), and it will still allow administrators to still view the store while logged in. However, it will display a custom maintenance message to regular visitor
Use Password Protect WordPress Pro for WooCommerce maintenance mode
PPWP Pro and its WooCommerce integration are the most powerful password protection plugin for WordPress users, allowing you to easily protect your WooCommerce store page with passwords.
This is a good option if you want a plugin that has no effect on your WordPress website. Users will still be able to access your homepage, read the blogs and contact the support team, but they will not be able to access anything to do with WooCommerce.
To enable this feature, you need to install both PPWP Pro and the WooCommerce Integration extension. Then, you can go to Pages and search for your store page.

Here you can enable password protection. It’s possible to lock the page with several passwords, and you can automatically generate new, random passwords or create your own passwords.
Your store page and all product pages are now protected from the public. The message “This content is password protected. To view it, please enter your password:” is displayed on the protected pages, and you can adapt this message to your use case and your requirements.
Conclusion
There’s a multitude of reasons why you may want to switch on maintenance mode with your WordPress website. You can also opt for password protection on your WooCommerce store, which will allow you to prevent visitors from ordering your products or landing on your incomplete store.
Password Protect WordPress Pro and its WooCommerce integration extension help you to temporarily disable your store page without affecting the website. They also help to secure individual product pages after the store has been made publicly accessible again.