Certain types of store may need to use WooCommerce private products.
WooCommerce does give us a very basic way to hide products. And WordPress itself provides the ability to password protect a page or even a product. However, neither of these methods is very satisfactory.
How to create WooCommerce private products
In this article, we’ll look at how to create private products in WooCommerce using a single plugin.
The WooCommerce Members Only plugin lets you set up your private products in a matter of minutes. You can decide who can access your content, define content is private and which is public. You can also set how to restrict access, e.g. by password or user role.
In total through this article, we’ll look at:
- Some reasons why you’d want to create private products and some different ways to make products private
- The different methods to protect your products, including password protection and user roles
- How to make all the products within an entire category private
- Plus, there are a couple of step-by-step guides for specific use cases
And, best of all, it’ll only take a few minutes.
You can easily navigate to the section you want using the menu below:
What is a private product?
First though, it’s always good to start with a definition. In this article, when we refer to private products, we mean products that have some or all of the following characteristics:
- Hidden from some customers or users
- Visible to all customers but only purchasable by some
- Password protected
- Restricted by user role
- Client specific products
WooCommerce hidden products
By default, WooCommerce doesn’t allow you to create private products. There is an option to make a product ‘hidden’, which only means that it won’t appear on the shop page or in product archives. It’s still accessible directly though if you have the URL.
This has limited application for us, particularly when we look at some of the ways to use private products below.
WordPress private posts and products
WordPress also allows you to make posts, including products, ‘private’. A private product in this sense means that only admins and editors can view it.
Again, this doesn’t help you if you want customers to view your private products.
WordPress password protected posts and products
WordPress itself allows you to password protect posts, including products. Again though, this has limited application. Perhaps it’s useful if you want to share a link with a colleague before you publish it to the world.
Private products are the answer
Private products, on the other hand, take the concept much further. They can be totally hidden from users, redirecting users to a landing page if they try to access the product with a direct URL.
They can also, if you wanted, be visible to all users but only accessible by some. It’s a bit like pressing your face against the window of a shop that you’re not allowed to enter.
What are the benefits of WooCommerce private products?
If you’ve landed on this page because you’re interested in how to create private products in WooCommerce, you might want to skip ahead to the next section.
But if you’re wondering how private products could benefit you, then this section is for you.
Here are a few good reasons why you might want private products in your store:
Client specific products
Client or user specific products are only available to certain customers. Good examples of this type of store include photographers or print shops who are creating products on a customer by customer basis and may only want those products to be visible to their owners.
There’s a whole article on client specific products and how to create them here.
Members only products
Maybe you’re running a membership site or you just have certain products that you’d like to offer exclusively to certain customers. Private products are perfect in this instance – you can hide them from the general public and making them accessible to customers you’ve selected.
Staff only products
If you are running a company that provides staff only equipment or material, then private products are the solution for you. You can use the main part of your shop to sell your customer products, then keep a section private for staff goods.
Age restricted products
If you’re selling alcohol or other age-restricted products, you won’t want to have those products in full view of any younger visitors browsing your store. The best way to keep them hidden is to make them private.
Many businesses provide branding services – for example, you might be running a B2B store where you supply other businesses with workwear. Having private products means you can separate products off from the rest of the store so that they’re only visible to the customers you want.
Create a password protected private product – a step-by-step guide
Let’s take a very simple example and imagine we’re creating a product that we only want a few of our customers to see.
Step One: Install WooCommerce Members Only
First of all, we need to install and activate the Members Only plugin. Members Only has all the features you need to make products private, enabling you to set global rules on content, categories, or drill down to specific products – setting unique privacy rules for different products if you wish.
Step Two: Ensure products are visible
With Members Only installed and activated, you can check the settings page to ensure that all your products are initially visible and not private.
Go to WooCommerce > Settings > Members Only and ensure the ‘Restriction Method’ option is set to ‘No Restriction’. This means that Members Only won’t apply any global restrictions.
Step Three: Make your selected product private
Now, go to the edit screen for the product that you want to protect from general customers.
In the ‘Product data’ panel, you’ll see a new tab called ‘Members Only’. Click on this.
Password protected product
Because we’ve decided that we’re going to password protect this product, set the ‘Restriction method’ to ‘Password’.
You’ll get a couple of new fields:
Setting multiple passwords for the same product
You can enter as many passwords in the ‘Passwords’ field as you like, just enter each one on a new line. All the passwords you enter in this field will be valid for this product.
The advantage of having multiple passwords is that you can give different customers different passwords if you wish. Also, if you’ve got several private products, you could make some passwords valid across all products while other passwords only work for certain products.
Hide in Archives
The ‘Hide in Archives’ setting allows you to fine tune your private product’s visibility. Whether you check this option or not depends on how visible you want your product to be.
If you select this checkbox, then the product won’t appear in any archives, including the shop page and search results.
If you leave it unselected, then the product will still be visible on those pages but no one will be able to view the product page itself without the correct password. This is a great option if you want customers to see that there are certain products in your store, perhaps as an enticement or encouragement to join.
Step Four: Publish your product
This is literally all you need to do to make your product private and protected by one or more passwords. You can go ahead and publish it now.
What happens when you don’t know the password?
Your selected product is now protected from customers who don’t have the password.
If a user tries to access the product page, they’ll be redirected to a landing page that you can define where they’ll be asked to enter their password. Let’s take a look at that in a bit more detail.
Defining your password page
When Members Only is installed, it will prompt you to ask if you want it to create a page to hold the password form.
If you click the ‘Yes’ button, the plugin will automatically create a new page and add a shortcode which will display a password form.
Now, when a user tries to access a product that’s password protected, they’ll be redirected to the page with the form where they can enter their password.
Create private WooCommerce categories
Okay, so we’ve seen how easy it is to make a single product private and password protected. Now let’s look at making multiple products private.
The simplest way to do this is through the use of private categories. Making a category private means that all the products within it are automatically private too.
We’ll look at two methods: creating a password protected category and creating a user role based category. I’m only going to cover these briefly – for a more in depth tutorial, take a look at this article on private categories.
Creating private products in a password protected category
In our first method, we’ll look at how easy it is to create WooCommerce private products using a password protected category.
Step One: Install Members Only
Firstly, you’ll need to install and activate Members Only (if it’s not already activated).
Step Two: Specify your private category
There are two ways to define private categories: globally and at individual category level.
To define private categories globally, go to WooCommerce > Settings > Fees and Discounts. Set the ‘Restricted Content’ field to ‘Specified Categories’ then in the ‘Restricted Categories’ field enter the categories you’d like to keep private.
Set the other parameters depending on your requirements: for example, set the ‘Restriction Method’ to ‘Password’ if you want to password protect the category.
Step Three: That’s it
That is how you create multiple private products by the use of protected categories. All the products within your specified categories will be private.
By the way, if you’re interested in protecting categories by user role, you should check out this article.
So, we’ve looked at what WooCommerce private products are and why you might benefit from using them in your store. We also looked at a couple of methods of creating them – firstly, creating a single private product and secondly, creating multiple private products through a protected category.
You can accomplish all this (and more) with a single plugin – WooCommerce Members Only.