How to password protect a WooCommerce shop the easy way
But, by default, WooCommerce doesn’t provide any way to add a password to your entire shop. That means, as is the WordPress way, you’re going to need a little help from a plugin.
To that end, I’m going to spend this post showing you how to password protect a WooCommerce shop using a simple but effective plugin with just a few settings. I’ll provide full written instructions plus a video tutorial. When you finish, you’ll know exactly how to get functionality like this for your shop using the WooCommerce Private Store plugin:
But first, let’s look at a couple of real-life examples from companies that needed to password protect a Woo shop.
Case study #1: Sprezzatura Imports
Sprezzatura Imports is a wholesale coffee distributor in the US. They specialize in importing the Italian coffee brand ICAF and sell to distributors through a private password protected WooCommerce shop. This is where our WooCommerce Private Store plugin comes in to play.
Only distributors can access the price list and purchase products, that’s why this area is locked away behind a login screen. To secure the private online shop, Sprezzatura Imports used our WooCommerce Private Store plugin. Everything Sprezzatura Imports want to hide from the public can be hidden in this secure area.
And to keep things simple, registered distributors can quickly access the password protected area as the login page has been added to the navigation menu.
Case study #2: Montana Medicinals
Gecko Designs were building a website for Montana Medicinals, who operate a medical marijuana dispensary in the State of Montana. For legal reasons, they needed to password protect their WooCommerce shop so that only pre-authorized customers could access it.
The developers achieved this in minutes using the WooCommerce Private Store plugin.
First, they used a sitewide WordPress age verification plugin to ensure that no one over age 18 can access the website at all. For added security, they used WooCommerce Private Store to password protect the WooCommerce shop.
When you click on the Shop link in the navigation menu, you are prompted for a password:
If Montana Medicinals have given you the password, then you can unlock the WooCommerce shop and purchase the medicinal marijuana within. If you do not have a correct password, then you cannot unlock the shop to view products or buy.
The developer was delighted with the plugin and wrote a glowing review:
How to password protect a WooCommerce shop
Beyond the obvious of having a WooCommerce store that actually needs password protecting, all you’ll need to follow this guide is the WooCommerce Private Store plugin. WooCommerce Private Store lets you protect your shop with one or more passwords, as well as choose:
- How long the store stays unlocked when a user enters the password
- What page users can log in to the store from
- Where to take users after they log in
When you use the plugin, every aspect of your shop is hidden until a user enters the password, including:
- Shop pages
- Navigation menu links
- Sidebar widgets
While the store functionality is hidden until the user enters a password, the rest of your site will function like normal. That is, your homepage, blog, regular pages, etc. will all still be visible to your visitors.
Step 1: Set up general settings
Once you’ve activated the plugin and entered your license key, go to WooCommerce → Settings → Private Store to set up the passwords that unlock your store, as well as a few other general options.
You can use a single password for everyone. Or, you can use the Plus icon to create multiple passwords that unlock your store.
Below the passwords, you should also enter a value for Password expires after. This setting lets you control how long, in days, the store remains unlocked after a user enters the password:
Below that, you can use the Redirect URL field to redirect the user to a specific page after they enter the password. If you leave this blank, visitors will just go to your normal shop page after they enter the password.
Finally, you can also choose whether or not to automatically unlock the store for Logged in users or specific user roles.
If you check this box, anyone who’s logged in to your WP site will not need to enter the password in order to see the store:
Step 2: Configure login form
Below the general settings, you can use the Login form section to configure the page where users log in.
The settings are all fairly self-explanatory:
How the plugin works in more detail
Once you password protect a Woo shop with the plugin, all traces of your store will disappear from the frontend of your site. All of your regular WP content will function normally, though:
If a user:
- Goes to the store login page
- Tries to access any WooCommerce page via a direct URL
They will see your login form like this:
And as soon as they enter a valid password, they’ll instantly see all of your:
- Store and product pages
- Navigation menu items
And that’s all there is to it!
For a more surgical approach, you can also use the WooCommerce Password Protected Categories plugin to password protect a single category of products, rather than your entire shop. You can also use our plugins to build a members-only WooCommerce store.
If you have any other questions about how to password protect a WooCommerce shop, leave a comment and we’ll be sure to help out.