How to Password Protect WooCommerce Categories

October 17, 2018

WooCommerce is one of the most versatile ecommerce platforms available in the web development industry. You can use it to build just about any type of ecommerce experience imaginable. Product categories are no different, and in this post, we’re going to show you how to use a plugin that allows you to keep WooCommerce categories hidden by locking them with passwords.

Password protecting product categories isn’t a popular feature among WooCommerce stores nor is it a default option of WooCommerce, but you’d be surprised by how useful it can be. Whether you want to sell wholesale products to a specific group of customers, create members-only products or even make free products available to customers after they complete specific actions, this is one of those unique features that can have a surprisingly large impact on your company’s business strategy. As far as implementation goes, we’re going to be taking look at one specific plugin—WooCommerce Protected Categories by Barn2 Media.

Password-Protected WooCommerce Products – Use Cases & Benefits

This isn’t a popular feature among WooCommerce stores or ecommerce stores in general, as previously stated. So, let’s go over a few different reasons as to why you’d want to create private products in your store that only certain customers have access to as well as the benefits of doing so. I already mentioned a few use cases, which are:

  • Selling wholesale products to a specific group of customers.
  • Creating member-specific products.
  • Offering free products to specific customers.

Wholesale products are traditionally intended for business-to-business transactions. They’re offered at what are typically large discounts due to the quantity they’re usually purchased in. Because of this, wholesale products are typically reserved for business customers. If your store caters to a mix of business customers and general consumers, you may want to hide wholesale products by grouping them into a single parent category and locking them behind a password.

For our second use case, a great way to encourage visitors to become members of anything is to provide things they cannot receive without subscribing. Offer specific products to paying subscribers by adding them to a category restricted to members only. The third use case has too many possibilities to list here, but you can use this plugin to offer certain products for free and only grant access to specific users. For example, if you offer a free email course, give the password to subscribers who complete the course.

A fourth use case involves creating customer-specific products. As Barn2 Media states…

“Lots of people use WooCommerce Protected Categories to sell hidden products that are only available to one customer. For example, photographers use it to sell photos that are personal to each client.”

The One Major Benefit of Creating Private Products

Given the many different use cases attributed to this plugin, its benefits are just as varied. Its main benefit is its ability to give you a way to offer premium services to your most valuable customers. Depending on how you use this plugin, you can improve and solidify your relationship with the customers who spend the most in your store by giving them access to products or discounts not available to regular customers. It costs more to attract new customers than it does to convince existing ones to return. Plus, returning customers spend over 50% more than new customers do, as multiple studies have cited. Therefore, it’s important to do all that you can to improve your relationship with the customers you already have by finding new ways to provide more value to them. WooCommerce Protected Categories is merely one way to do just that.

About Barn2 Media

Barn2 Media

Barn2 Media, the company that developed WooCommerce Protected Categories, is a family-run WordPress business based in England. The company was founded in 2009 where they developed custom WordPress sites and plugins on a client-by-client basis. That changed in 2016 when the company decided to switch gears and release official premium plugins to the general public. Today, it has a solid collection of premium WordPress plugins developed by a small yet innovative team and used by over 5,000 websites around the world. These plugins include WooCommerce Private Store, a similar plugin called Password Protected Categories and WooCommerce Product Table, which we show you how to use in our How to Create a WooCommerce Product Table tutorial.

Overview of WooCommerce Protected Categories

WooCommerce Protected Categories

Disclaimer: This article was originally written in September 2018 and may not reflect current pricing/features.

WooCommerce Protected Categories is a simple plugin that allows you to lock product categories you create with WooCommerce behind passwords. You can protect entire parent categories and individual child categories or restrict access to specific user roles and/or specific users. It’s designed for store owners who only want to hide a specific section of their store or specific products. If you want your entire store to be private, consider using WooCommerce Private Store.

Here’s a quick breakdown of this plugin’s features:

  • Password Protection – Restrict access to products by providing password protection for parent categories and individual child categories. Customers are prompted to enter your password on a central login form. You can create multiple passwords for each category.
  • Hide Protected Categories – Keep customers from seeing the products you password protect by hiding entire categories from your public store.
  • Hide from Navigation Menus – Hides protected categories from every navigation menu on your site. They’ll only appear for logged-in users who enter the correct passwords.
  • Control Who Has Access to Password-Protected Categories – Restrict access to your password-protected categories by controlling which types of users can view them, i.e., subscribers, customers, etc., as well as which specific users can view them.

Those are the basic features included with this plugin. We’ll go over more specific features as we go through this tutorial. Speaking of which, let’s get into it.

Installing & Configuring WooCommerce Protected Categories

WooCommerce Protected Categories is a premium WordPress plugin, so you’ll need to purchase a license for it from Barn2 Media prior to installing it. A single site license costs $99/year, and your purchase is protected by a 30-day, money-back guarantee. Once you purchase it, download the plugin from Barn2 Media, and upload the ZIP folder to the WordPress admin or the extracted version via FTP. Activate it afterward.

Go to WooCommerce → Settings → Products → Protected Categories to activate your license key. Barn2 Media has a helpful article if you run into trouble activating your key and need to troubleshoot.

WooCommerce Protected Categories - License Key

As far as settings go, start by configuring the way your protected categories appear in your store. If you want to hide categories you lock behind passwords, deselect the first two settings in the Category Visibility section. They control whether the products in your protected categories or the names of your protected categories appear in your navigation menu(s), store, category pages, sidebar(s) and search results. Customers will need to log in to view these categories/products.

If you choose to show them, you can add “Private” or “Protected” prefixes to them with the Prefix Category setting.

WooCommerce Protected Categories Settings

Many of the remaining settings have to do with the way protected categories behave as far as user input goes. For starters, you can control which page users are redirected to when they log out. Your options are a 404 error page, the WordPress login page or a custom page. It’s probably best to use the login page option or create a custom login page informing users they’ll need to log back in if they want to view the categories/products.

You can control how long a password remains unlocked with the Password Expiry setting. You can also control where users will use the main login form using the Password Entry Page. If you’d like to create your own page or use the login form in a text widget, use the shortcode “[category_login]” without the quotes. Go through the remaining settings to control the text and labels that display when a user runs into a protected category.

Preparing Your Categories

The next step involves a bit of planning and strategizing on your part due to the following rules that are applied to protected categories:

  • Protecting a parent WooCommerce category automatically protects its children. This means a user who enters the correct password for a password-protected parent category will gain access to its children and grandchildren automatically.
  • A single product can only be in one protected category.
  • A single product cannot be in a public and protected category at the same time.

Consider which products you want to protect via password and who you want to sell them to. If they can be sold to a specific group of customers, create one parent category for them, such as “Private Store” or “Wholesale Store,” and create child categories accordingly. However, if you want to sell the same item privately to different types of customers or sell the same product in your public and private stores, Barn2 Media suggests using a plugin called Duplicate Post to duplicate your products with ease. This will allow you to designate one version of the product to Customer Group A or Store A and the other to Customer Group B or Store B.

Creating Your First Password-Protected WooCommerce Category

WooCommerce Protected Categories - Visibility

With WooCommerce Protected Categories activated, you’ll see a new Visibility setting when you create new WooCommerce categories. Here are the options available under this setting:

  • Public – This option is selected by default. Categories with this Visibility setting will behave like normal and will appear visible for all users no matter what.
  • Protected – Choose this option for categories you want to protect with passwords. You can also restrict them to specific user roles, but more on this later.
  • Private – Choose this option to hide categories from your store entirely. This option is typically restricted to store managers and site administrators.

When you choose the Protected option, you’ll have the option to password protect the category, restrict the category to specific user roles, restrict the category to specific users or all three. If you need to update the Visibility setting for existing categories, simply edit the category as usual.

WooCommerce Protected Categories - Password Protect Options

When you choose the Protected option, you’ll need to input the specific details you want to use for each individual sub-option. For the Password Protected sub-option, you can input as many passwords as you like. Users can enter any one of these passwords to gain entry. For the User Roles sub-option, you simply need to select the user role(s) you want to give access to:

WooCommerce Protected Categories - User Roles

If you want to sell wholesale products to a specific group of customers in business-to-business transactions, use the Users sub-option, and select those customers’ usernames from the list.

Creating Private WooCommerce Categories

Barn2 Media suggests using the Protected Visibility option and the User Role sub-option if you want full control over which user roles receive access to protected categories. This is because private WooCommerce categories behave in the same way private WordPress pages and posts do. This means only Admin and Shop Manager accounts have access to private WooCommerce categories by default. Therefore, it’s best to reserve private categories for products you only want admins and store managers to have access to, such as products that aren’t ready for public consumption, yet.

Hiding Protected WooCommerce Categories from Search Engines

There’s no way to properly hide protected WooCommerce products or categories from search engines. However, you can use the Yoast SEO plugin to set individual product categories to “noindex” to prevent them from being indexed, which should prevent them from appearing in search engines.

Yoast SEO - noindex WooCommerce Category

You can do this (with Yoast SEO installed) by navigating to Products → Categories → Edit Category (for whichever password-protected category you want to hide from search engines) → Yoast SEO Meta Box → Settings. Once there, select No for the setting labelled “Allow search engines to show this Category in search results?”

You can do this with The SEO Framework as well by editing your password-protected category and selecting “Apply noindex to This Term.”

Final Thoughts

Those are the basics of password-protecting WooCommerce categories and using WooCommerce Protected Categories. If you want to protect an entire store, we recommend using Barn2 Media’s plugin WooCommerce Private Store.

WooCommerce Protected Categories is available for as little as $99/year for a single site license. Discounts are available for customers who need multiple site licenses. Grab the plugin today by visiting Barn2 Media’s store page, or check out their demo if you’re not quite sure.

Visit Barn2 Media