Are you looking to hide a category in your WooCommerce store? One that will remove certain products from view? Perhaps you want to create a members-only section or create a hidden area for private clients?
Whatever the need, it becomes really challenging to achieve this with a default WooCommerce install. This is because it doesn’t come with an inbuilt ‘hide product category or subcategory’ option.
But there’s good news – you can still hide a category in WooCommerce with the help of a plugin. So in this guide, we’ll show you how to do it with the plugin WooCommerce Protected Categories.
By the end of this article, you’ll know exactly how to hide one or more categories from your WooCommerce store. Our easy-to-understand step-by-step tutorial will show you how to restrict targeted categories based on passwords, users, and user roles.
But first, let’s discuss why you might want to hide a category in WooCommerce, depending on the type of store you have.
Why hide a product category in WooCommerce?
Hiding categories in your WooCommerce store makes it easy for you to hide multiple products at once instead of hiding individual products in your product and shop pages.
To understand this further, let’s look at a few situations where you might want to hide a product category in your WooCommerce store.
You have a member-only site
If you want to create a members-only store, you might want to keep some products hidden. You can show certain products like discounted items or imported goods only to your club members or B2B clients.
This way, you can keep certain products hidden from the average visitors, but display the choicest members-only products on the WooCommerce member’s site.
It enables your members to have access to these products only after logging into your WooCommerce store.
You have private clients
Hiding specific categories in your WooCommerce store can help you make available targeted products to your private clients only.
For example, if you’re a photographer, you can create a private category of products for them. This will ensure only the customer can view their personalized products i.e. photographs.
These products would then only be visible if the client enters a particular password in your WooCommerce store. The members will then be automatically redirected to the hidden products.
You have wholesale products
If you want to set up a wholesale section for your online store, you might want to restrict one or two categories depending on the user.
Instead of just hiding the wholesale price of some products or making a separate wholesale category page, you can hide the whole category in your public-facing WooCommerce store in a single go. These products will be shown only to targeted B2B clients, industries, companies, etc. Plus, you can hide as many categories as you want.
How to hide a category in WooCommerce
While there’s no ‘hide category’ option in the standard WooCommerce product and shop pages, you can easily hide categories and products using the WooCommerce Protected Categories plugin.
This plugin gives you the ability to lock and hide entire product categories to certain users, user roles, or create passwords for category protection.
The added benefit is that it supports multiple passwords for each category. That means customers enter a password on a central login form and are redirected to the correct hidden category.
Plus, it also protects product subcategories. Meaning – once you’ve protected a WooCommerce category, its products, and any sub-categories automatically inherit the same protection.
Here are some of the key features of the WooCommerce Protected Categories plugin:
- It lets you sell private products to each client, protected by a password or account login.
- You can create a private login page that directs each customer to their hidden products.
- It also lets you create a hidden area for B2B clients or members.
- Accessible only to those with the correct password or user role – so you can pre-approve your customers.
- No need to create a separate wholesale shop.
- You can optionally hide protected categories from menus and widgets.
For this tutorial, you’ll need a WooCommerce site with products already set up. You’ll also need to purchase the WooCommerce Protected Categories plugin.
Step 1: Install WooCommerce Protected Categories
Once you’ve purchased WooCommerce Protected Categories from the Barn2 store, you need to take the following steps:
1. Go to Plugins > Add New > Upload Plugin.
2. Choose the zip file you downloaded, upload, and then click Activate.
3. Once activated, you’ll need to enter your license key.
With WooCommerce Protected Categories now installed, we can move on to hiding your categories in WooCommerce.
Step 2: Hide your WooCommerce categories
After installing and activating WooCommerce Protected Categories, you’ll need to take the following steps.
1. Go to Products > Categories and click edit on the categories you need to hide.
Note: You can either create a new category to house your hidden products or you can edit an existing category. Whichever method you choose; you’ll see a new Visibility section at the bottom of the page.
2. Click the ‘Protected‘ option, and choose between:
- Password protected – Visitors will need to enter a password to see the category. You can create multiple passwords to unlock the category if needed.
- User roles – Your category will only be visible to certain user roles.
- Users – Your category will only be visible only to the users that you select here.
3. Once you’ve hidden one or more categories, go to WooCommerce > Settings > Products > Protected categories to change a few more basic settings.
Step 2a: Change settings for your WooCommerce protected categories
One important option you should look out for in your WooCommerce Protected Categories settings is the Category Visibility option.
You will have to uncheck both the boxes in the category visibility option to completely remove a WooCommerce category from the shop page.
By checking in both the boxes, you can display the category to users with login credentials or passwords. You can also add menu links to your hidden categories to show the hidden products in WooCommerce ‘Products’ widgets.
Once you’ve hidden categories from the WooCommerce shop page, you need to provide access to selected customers to view the hidden category.
- By providing access to password-protected categories in WooCommerce, you can allow the right customer to see the hidden categories. You can create a central category login form by adding the shortcode
[category_login]to any page. For detailed instructions for adding a shortcode to a page, follow our WooCommerce shortcodes guide.
Once the user account is unlocked, the customer will be able to see the protected categories and products in their WooCommerce shop page, in navigation menus, and widgets.
Hide a category from the shop page in WooCommerce
Using a WooCommerce Protected Categories plugin in your WooCommerce store is a great solution.
Especially if you want to:
- Sell exclusive products.
- Hide categories that are user/user role-specific.
- Hide categories that aren’t needed anymore.
- Or when you simply want to make your store look organized.
With WooCommerce Protected Categories, you’ll be able to hide categories (and any sub-categories) in three different, yet simple ways. Either by restricting access to categories based on the user, user role, or by using a login password for category protection.
This plugin also enables you to organize your shop page more efficiently, so that your customers can find the products more easily. It enables you to choose specific categories to be displayed in the customized layout.
Overall, WooCommerce Protected Categories provides easy navigation and user experience on your WooCommerce store.