How to hide a category in WooCommerce [+ video]
If you sell products to different types of buyers, you might need a way to show different products to different customers. The easiest way to do this is by hiding a category in WooCommerce. This way, you can sell products to different customers from a single online store.
In this tutorial, we’ll show you how to hide a category in WooCommerce using the WooCommerce Members Only plugin. We’ll look at several options, including:
- Hiding categories by user role or by password
- Hiding products within certain categories
- Displaying products but preventing the user from purchasing products from certain categories, e.g. by removing the add to cart button
Before we begin, let’s quickly take a look at when you might need to hide a category in WooCommerce.
Why you might want to hide a category page
WooCommerce lets you organize products into different categories. The category page on the front-end displays all products sorted into that category.
Depending on the types of products you sell and the types of customers you sell to, you might want to hide a category in WooCommerce. Here are a few common reasons why:
Reason #1: Hide products within categories
Store owners may want to hide a category page from their WooCommerce store to prevent access to certain types of products. This way, customers won’t be able to add them to their cart.
For example, if you run a membership site and sell merchandise, you might want to prevent regular site visitors from accessing the customizable products. This way, only users with the Member user role will be able to purchase the customizable products.
Similarly, you can choose to hide products that are currently out of stock from the category page of your WooCommerce store. This way, customers won’t add out of stock products to their cart only to find out later that they can’t buy it. This helps you deliver a better user experience.
Reason #2: Show different products to different users
Hiding WooCommerce category pages on your online store means that you can show different products to different users.
For example, if you have a loyalty program set up, you might want to show specific products to your most loyal customers only. These can be selected products that regular customers don’t have access to.
You can also use this to show exclusive products to subscribers or loyal customers before making them available to regular customers on your online store. This is a great way to encourage people to sign up to become loyal customers.
Reason #3: Offer different prices to different users
You can hide a category page in WooCommerce to offer different prices to different users. For example, if you sell branded t-shirts, you might want to sell them to Members for a lower price than your regular customers.
You can create a separate category page for each user role so that they see the correct price when they log in with their account.
When you might need to hide category pages
Let’s quickly go over some scenarios when you might need to hide a category page on your WooCommerce store:
To motivate visitors to become loyal customers
You can motivate regular customers to become brand loyal customers by offering them exclusive products. This is a simple way to create a sense of exclusivity for loyal customers.
If regular customers want to buy those specific exclusive products, they’ll need to become members first. You can boost engagement on your WooCommerce store and increase customer retention.
Offer better prices to some user roles
You can offer better prices to members or shop managers, while regular customers pay the standard price. This helps give your valued members and staff members a more favorable price and can help boost sales.
For instance, you could offer a member-exclusive category page that has product offerings at a discounted price only for subscribers and staff members. Additionally, this can be a great way to incentivize regular customers to sign up for your email list or become members so that they can avail discounted prices.
Sell products to both retail and wholesale customers
If your online store sells to both retail and wholesale customers, you may need to hide some WooCommerce categories from your online store. This could be because you sell different products to retail and wholesale customers.
You can do this by hiding wholesale-only product categories from retail customers. This prevents retail customers from being able to see items that are available only at bulk prices.
For instance, you can hide category A from customers and hide category B from wholesale customers. This helps you sell to all types of customers from one WooCommerce store.
How to hide a category in WooCommerce
Here, we’ll show you how to use the WooCommerce Members Only plugin to hide a WooCommerce category page.
For this tutorial, we’ll assume you already have a WordPress site set up with the WooCommerce plugin installed and activated. We’ll also assume you have some products added to your WooCommerce store and sorted into categories.
Related Tutorial
Check out this tutorial for a complete guide on getting started with WooCommerce
Step #1: Install and activate WooCommerce Members Only
Start by getting the WooCommerce Members Only plugin and installing it on your WordPress site. Then, navigate to WooCommerce > Settings > Members Only > License and enter the license key in the ‘License Key’ box.
Click the ‘Save changes’ button to continue.
Step #2: Hide WooCommerce Categories
You can hide WooCommerce categories from your online store using the WooCommerce Members Only plugin in different ways including by user role and by password.
By user role
If you sell to different user roles, you can hide a category in WooCommerce for specific user roles. This way, you can sell different products to different types of customers.
For instance, you can choose to sell member-exclusive products to Members or people who subscribe to your email list (i.e. your Subscribers) and not to everyone who visits your WooCommerce store. Only users with the correct user role will be able to order those products.
Additionally, you can hide categories in WooCommerce from certain user roles to sell to both wholesale and retail customers. This way, wholesale customers and retail customers on your WooCommerce store get to see products that they’d be interested in purchasing.
Here’s how you can hide WooCommerce categories by user roles using the WooCommerce Members Only plugin:
- Navigate to WooCommerce > Settings > Members Only > User Roles from the admin panel to create user roles
- Next, navigate to WooCommerce > Settings > Members Only
- Select ‘User Role’ in ‘Restriction Method’
- Choose ‘Specified Categories in ‘Restricted Content’ – this will let you select specific categories from your WooCommerce store to be accessed only by specified user roles
- Enter the WooCommerce categories you’d like to hide in ‘Restricted Categories’
- Now, enter one or more user roles that can access the hidden categories in the ‘Permitted User Roles’ field
- Once you’re done, click the ‘Save changes’ button to continue
This will restrict the specific WooCommerce category on your online store from some user roles. Everyone will be able to see the category but only permitted user roles will be able to access the category and the products in it.
We’ll look at how to hide the category completely later.
By password
Another easy way of hiding a WooCommerce category is by setting up a password that you can give out to customers. This is ideal for hiding products and categories from your main shop page.
Instead of having to choose specific user roles that have access to the product categories, you can simply give out the password to individual users.
For example, if you sell wedding photography packages, you can give out passwords to couples who are interested in hiring you to cover their wedding reception. This way, you can share pricing details to qualified leads instead of everyone who visits your online store.
You can create one or more passwords and hand them out to different users on your online store to password-protect WooCommerce categories. Only users with the correct password will be able to access the hidden, password-protected WooCommerce category.
Here’s how you can do that using the WooCommerce Members Only plugin:
- Navigate to WooCommerce > Settings > Members Only
- Choose ‘Password’ in ‘Restriction Method’ – this will require users to enter a password when they visit a specified WooCommerce category
- Choose ‘Specified Categories’ in ‘Restricted Content’
- Enter the product categories you’d like to hide in ‘Restricted Categories’
- In the ‘Permitted User Roles’ field, enter one or more user roles that can view hidden categories
- Now, enter one or more passwords in the ‘Passwords’ text field
- Choose the page your password form is added to using ‘Password Form Page’
- Once you’re done, click the ‘Save changes’ button to continue
This will password protect specific WooCommerce categories on your WooCommerce store. Users with the correct password will be able to access the different hidden products and categories on your online store.
Step #3: Preview
Here’s what the shop page will look like for an authorized user:
This is what the category page looks like for an authorized user:
And here’s what unauthorized users will see:
Notice how there aren’t any add to cart buttons? This is because we don’t want to let unauthorized users add products to their cart and place an order. You can also choose to hide the price from the category page.
Bonus: hide category in WooCommerce completely
We showed you how to hide WooCommerce categories by user role and by password. Although the product categories are still visible to unauthorized users, they cannot access them or add products to their cart. You might do this if you want to encourage visitors to create an account on your online store or sign up for a membership.
You can also use the WooCommerce Members Only plugin to hide categories in WooCommerce completely. This means that the categories and products won’t be visible to users who don’t have access to them.
Here’s how you can do this:
- Navigate to WooCommerce > Settings > Members Only
- Tick the Hide in Archives checkbox to remove products from the shop and category archives
- Optionally, you can tick the Access Product Pages checkbox if you want to allow users to view product pages but not make purchases
- Click the Save changes button
The restricted categories won’t appear on the shop page.
How to hide a category in WooCommerce – the video
Here’s a video on how to hide categories in WooCommerce.
Conclusion
Using the WooCommerce Members Only plugin, you can hide a category in WooCommerce by user role or password. This way, you can prevent unauthorized users from accessing and placing orders for selected products.
Ready to hide a category in WooCommerce? Get WooCommerce Members Only today!