Most store owners WooCommerce try to display their products in front of as many eyeballs as possible. More traffic is always good because it means a better chance of making a sale, right?

This post is not intended for store owners WooCommerce.

Instead, I'll talk about a more specific use - password protecting certain product categories WooCommerce to restrict access .

Why on earth would you want to password protect WooCommerce categories? There are indeed a lot of situations where this makes sense. Here are a few that come to mind:

  • Wholesale Stores - If you are a wholesaler, you probably don't want your prices and product listings to be publicly available, then password protection allows you to restrict access to only authorized buyers.
  • Private customer areas : you can create separate categories for each customer to sell a unique set of products to each customer.
  • Member Store - you can create an entire store only accessible to members.
  • Mix-and-match - you can leave most of your store public as usual, but a password protects some restricted products that you don't want everyone to see.

In this tutorial, I'll walk you through how you can use Barn2 Media's WooCommerce Password Protected Categories plugin to accomplish all of these uses ( and everything you can imagine! ).

Here is what Woocommerce Password Protected Categories

WooCommerce Password Protected Categories is a premium plugin that allows you to add password protection to one or more of your WooCommerce product categories.

On the surface, it may seem quite simple ...

But there are actually cool things under the hood:

  • Individual products in the category are also password protected, in case someone gets their hands on a direct link to a product.
  • You have the option to completely hide your password-protected categories or to have them always in the public list ( just not accessible without the password ).
  • Once the customer enters the password, all products in that category are automatically unlocked - there is no need to reenter the password.
  • You can use a single sign-on page for all customers. Customers will be automatically redirected to the corresponding category based on the password they entered.

Doesn't WooCommerce already have such an option

Not really ! I mean you pouvez add password for individual WooCommerce products using control visibility of WordPress.

This is great if you just need to restrict access to a single product. But it is not practical when it is necessary to protect products of a specific category, because:

  • You have to limit each product individually, which is a huge pain if you have to do it on more than 20 products.
  • You can only use one password for each product, rather than giving each person a unique password.
  • There is no single sign-on option.

Essentially, the WooCommerce Password Protected Categories offer a solution that is both:

  • More flexible
  • Faster

And that's a nice combined value proposition.

How do password protected categories work?

Ok, now you have a good idea of ​​what WooCommerce Password Protected Categories can do.

But how does it really work on your WooCommerce store ?

Let's explore this quickly ...

Once you have installed and activated the plugin, the first thing you want to do is configure some basic settings.

Plugin settings

You can access the plugin settings by accessing WooCommerce → Settings → Products → Password protected categories.

categories protected by a password.png

Here's everything the plugin allows you to configure:

Visibility of the category - choose to display or not the categories / products protected by password in:

  • Your shop
  • Your navigation menus

product visibility in the menu.png

  • The password expires after - choose for how many days the category will remain unlocked after a user enters the password.
  • Category prefix - add a "private" designator before a category on the category page and in menu items.
  • Customer login page - (optional) designates a single sign-on page for your customers. Remember - you can use a different password for each person and they will automatically be redirected to the corresponding category .

setting up the wordpress.png login page

Finally, you can also configure the text and style of your online form password:

create a login form configure the fields.png

How passwords protect categories

Once you have configured the basic settings of the plugin, it's time to start restricting certain categories!

To do this, you go to the WooCommerce product category box ( Products → Categories ).

Now when you create a new category or edit an existing category, you get a new option of visibilite :

category visibility option.png

If you choose the option Password Protected, you can add one or more passwords for the category ( you can also choose theoption Private to make the categories private ).

The ability to add multiple passwords is useful because it allows you to give each client or user their own password. To add an additional password, simply click on the icon More :

adding categories woocommerce.png

Once you are done adding passwords all you need to do is save your changes to start category password protection.

What does it look like for visitors trying to access a protected category?

Now that you've password protected a category, anyone who tries to access it will see something like this:

presentation of protected categories.png

You can, of course, customize this online form with your own text style and CSS .

Once that person enters a valid password, they will be able to browse the category and all of its products as usual:

As I showed you in the settings, you can also choose to create a single sign-in page for all your customers.

This page is built using a shortcode, so you can insert it wherever you want, even with page builders like Visual Composer:

Remember, with this login page, users will automatically be redirected to the corresponding category for the specific password they entered. For example, if you have a situation where:

  • MotDePasseA links to the Category A
  • MotDePasseB links to the Category B

So:

  • Anyone who enters MotDePasseA will be redirected to Category A
  • Anyone who enters MotDePasseB will be redirected to the category B

This feature is especially useful if you want to create different zones for your customers because it allows you to reuse the same login page for all your customers.

That's it for this tutorial, I hope it allows you to create protected categories for WooCommerce.