How to hide a category in WooCommerce [+ video]

There are all kinds of reasons to hide a category on your WooCommerce store. You might want to show different products to different customers or incentivize users to create an account on your store.
In this article, we’ll look at what options WooCommerce offers out of the box to hide categories. And we’ll look at how to extend its functionality through an additional plugin.
We’ll look at how to:
- Use the default WooCommerce method to hide categories
- Hide categories by user role, password, login status, or by specific users
- Hide categories from the WooCommerce shop page
- Hide categories programmatically through code
If you want to hide categories using more than just the default WooCommerce method, the easiest way is to use the WooCommerce Members Only plugin.
But before we dig into this, let’s quickly look at what categories are in WooCommerce.
How categories work in WooCommerce – a quick explainer
WooCommerce lets you organize products into different categories. Each category has its own dedicated page which lists all the products within that category. Products can belong to more than one category.
Categories can also have subcategories – so your main category for ‘Clothing’ can have subcategories for ‘Teeshirts’ and ‘Hoodies’, for example.
As well as the category pages, there is the main ‘Shop’ page which can display products and/or categories.
How to display and hide categories the default WooCommerce way
When you create your WooCommerce store, you have options over how to display products and categories. You can access these options through the WordPress Customizer.
To adjust how categories are displayed in WooCommerce:
- Click on the ‘Customize’ option in the admin bar
- Select ‘WooCommerce’ from the menu panel on the left
- Select ‘Product Catalog’ from the submenu

You’ll see several further options.
Hide product categories from the WooCommerce shop page
To ensure that only products are displayed on your shop page, update the ‘Show page display’ setting:
- Show products: this will display just products on your main shop page. This is ideal if you want users to be able to click directly into product pages
- Show categories: in this case, your shop page will display a list of each category with a representative image. The user would then click one of these categories to view a category page
- Show categories & products: choosing this option will display both products and category items

Hide subcategories on category pages
Update the ‘Category display’ setting:
- Show products: select this to list all the products belonging to a specific category on the category archive page
- Show subcategories: select this to show a list of subcategories
- Show subcategories and products: choose this to show both types of content
So, the default way to hide a WooCommerce category is to use these options. This is fine if you simply want to list products on your site without having links to categories and subcategories on the shop and archive pages.
However, you may want more advanced functionality than this. Let’s look at some further options.
How to hide a WooCommerce category using the Members Only plugin
Members Only is a complete membership plugin for WooCommerce specifically designed to allow you to hide different kinds of content, including product categories, to different users.
Members Only allows to hide WooCommerce categories in several ways.
- User role: hide WooCommerce categories from certain user roles while allowing others to access them
- User ID: hide categories from specific users
- Log in status: hide protected categories from guest users (not logged in)
- Password: add a password form so only people with the correct password can access the hidden categories
When you hide your content, you create a membership plan. Membership plans are rules to restrict certain content from specific groups of users – and you can create as many as you want. So you can hide different categories from different users if you wish.
You can also create dedicated landing pages to direct users to when they try to access hidden content.
Let’s look at several different methods to hide categories using Members Only.
Method #1: Hide WooCommerce categories by user role
In WooCommerce, each user is allocated one or more roles. These are ways of controlling what a user can do on a site. As such, they’re an ideal method to control what content a user can access.
For example, if you run a membership site, you might want to sell certain products to all visitors. But there might be some products that you’d like to sell to members only. This could be merchandise or products that are related to membership content.
Or, you could want to hide some product categories from your retail customers, and only allow wholesale customers to access them.
(And not only does Members Only allow you to restrict access to content in this way, it also allows you create and edit user roles on your site. See below for how to create user roles.)
How to hide a WooCommerce category by user role
To hide a WooCommerce category by user role:
- Go to Members Only > Settings
- Choose ‘User role’ as the ‘Restriction Method’
- Enable the ‘Hide in Archives’ setting

- Then, go to Members Only > Plans and click ‘Add New Plan’ to create a new membership plan
- Choose ‘Specific content’ in the ‘Restricted Content’ field
- Choose ‘Product Categories’ in the ‘Content Type’ field
- Select the product categories to hide in the ‘Restricted Product Categories’ field. You can choose as many as you like here
- Finally, enter the user roles that are allowed to see the hidden category in the ‘Permitted User Roles’ field


Now, the product categories you chose will no longer appear in any category archive and the products within these categories won’t be shown to regular visitors. Customers won’t be able to directly access the pages of products within these categories either.
You can create as many membership plans as you like – so you can create one plan that restricts Category A to User Role A, another plan that restricts Category B to User Role B, etc.
Redirecting blocked users
You can also use the Members Only plugin to redirect users to a specific page (for example, a registration page) if they do not have the correct permissions to access the hidden category. All you have to do is set the ‘Landing Page’ option to the page you want to redirect users to.

If you have multiple plans, you can direct the user to different landing pages based on the content they are trying to access.
Creating and editing new user roles
Members Only lets you create user roles if you don’t already have user roles created. To do this:
- Go to Members Only > User Roles in the admin panel
- Enter the name of your new user role in the ‘Enter role name’ field
- Click ‘Add role’ and your role will be created

Method #2: Show categories to specific users
If you want to hide categories from nearly all the users on your site, you can follow the steps in method #1 above – but instead of entering any roles in the ‘Permitted User Roles’ field, you can choose specific users in the ‘Permitted Customers’ field.

Method #3: Hide categories from guest users
It’s also possible to hide a WooCommerce category according to the logged-in status of users – so users who are logged in can view products, users who are not logged in are locked out. This can be useful if you only allow registered customers to access your products.
For example, you might encourage customers to sign up for an account to gain access to exclusive products and deals. This also works for online stores that want to sell certain products to wholesale buyers or members only.
How to hide a WooCommerce category from users who aren’t logged in
To hide a WooCommerce product category from users who aren’t logged in:
- Go to Members Only > Settings
- Select ‘Log-in status’ as the ‘Restriction Method’
- Enable the ‘Hide in Archives’ setting

- Then, create a new membership plan at Members Only > Plans
- Choose ‘Specific content’ in the ‘Restricted Content’ field
- Choose ‘Product Categories’ in the ‘Content Type’ field
- Finally, select the product categories to restrict in the ‘Restricted Product Categories’ field. You can choose as many as you like here

Method #4: Hide WooCommerce categories by password
You can hide an entire WooCommerce category by setting up a password. This is perfect for when you want to hide certain products and categories from the main shop page but don’t have specific user roles you’d like to grant access to.
For example, if you’re a wedding photographer, you’ll be able to password-protect online galleries. This way, only people with the correct password will be able to view their photos and choose which ones they’d like to purchase.
Password protecting WooCommerce categories enables you to create one or more passwords that can be distributed to different users. This way, only users with the correct password will be able to access a protected WooCommerce category.
How to hide a WooCommerce category using a password
To hide a WooCommerce product category from users using a password:
- Select ‘Password’ as the ‘Restriction Method’
- Enable the ‘Hide in Archives’ setting
- Go to Members Only > Settings
- Select a page in the ‘Password Form Page’ setting that contains the form where users can enter their password. Note that Members Only will automatically create this page for you

- Then, create a new membership plan at Members Only > Plans
- Choose ‘Specific content’ in the ‘Restricted Content’ field
- Choose ‘Product Categories’ in the ‘Content Type’ field
- Select the product categories to restrict in the ‘Restricted Product Categories’ field. You can choose as many as you like here
- Finally, enter one or more passwords in the ‘Passwords’ field. You can add as many passwords as you like – just put each one on a new line

Can I hide product categories from search engines?
All the methods above will ensure that your hidden categories and products will also be hidden from search engines. So Google or any other search engine that is indexing your site will not be able to crawl hidden categories.
That’s how to hide categories in WooCommerce using Members Only.
How to hide a WooCommerce category – video
Here’s a video for how to hide categories in WooCommerce.
Using code to hide categories
If the default method to hide categories on the shop and category pages isn’t suitable for you, and you don’t want to use Members Only, then there’s always the option to hide categories programmatically.
Here are some code snippets to help you with this.
Snippet to hide product category from main query
<?php | |
/** | |
* Hide product category from main query | |
* Update line 17 with the slug of the category to be hidden | |
*/ | |
function pr_product_query( $q ) { | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() && is_shop() ) { | |
$tax_query = array( | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => array( 'hoodies' ), // Update the value here | |
'operator' => 'NOT IN' | |
) | |
); | |
$q->set( 'tax_query', $tax_query ); | |
} | |
} | |
add_action( 'woocommerce_product_query', 'pr_product_query' ); |
Snippet to hide products from specific categories on shop page
<?php | |
/** | |
* Hide products from specific category on shop page | |
* Update line 13 with category slugs to hide | |
*/ | |
function pr_product_query_tax_query( $tax_query, $query ) { | |
if( ! is_shop() ) return $tax_query; | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', | |
'terms' => array( 'hoodies' ); // Update slugs here | |
'operator' => 'NOT IN', | |
); | |
return $tax_query; | |
} | |
add_filter( 'woocommerce_product_query_tax_query', 'pr_product_query_tax_query', 10, 2 ); |
Why you might want to hide WooCommerce categories
Hiding WooCommerce categories lets you:
- Show different products to different users
- Offer different prices to different users
- Encourage customers to create an account, turning them into loyal members or subscribers
Hiding one or more WooCommerce categories enables you to restrict access to multiple products in one go. So, let’s say you want to set up staff-only product pages on your website for selling staff apparel or specialist equipment, you can simply allocate these products to a category and hide the entire product category.
Check out our tutorial on how to create private products on your WooCommerce store if you only have a few products that you’d like to restrict access to.
Reason #1: To 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.
Reason #2: To incentivize customers
You can choose to hide specific products from the public but still let specific user roles buy them. This way, you can create a sense of exclusivity for specific types of users such as members. So, if regular customers want to buy the hidden products, they’ll have to become members first.
Reason #3: To offer discounted prices to members or staff
If you run a membership site, you already know why it’s important to offer discounted prices for growing your customer base and boosting sales. Implementing differential pricing on your ecommerce site also helps you give your site members a more favorable price which encourages non-members to subscribe to your website.
Similarly, many online shopping stores offer staff discounts and purchase programs that let staff members buy products at discounted prices.
Check out this article on how to set prices by user role.
Reason #4: To 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 #5: To sell products on your retail store and wholesale store
If you sell to both retail and wholesale customers on a wholesale or B2B store, you have to make clear distinctions between the products and prices available for each type of customer. For instance, you might offer significant discounts to wholesale buyers because they buy products in bulk.
You can do this by hiding wholesale-only product categories from retail buyers. This way, retail customers won’t be able to see items that are available only at bulk prices.
FAQs
To hide a category in WooCommerce, use the Members Only plugin. Go to Members Only > Plans and create a new membership plan. Enter the categories to hide in the ‘Restricted Product Categories’ field and save your settings.
Yes. To make a category private in WooCommerce, use the Members Only plugin. Go to Members Only > Plans and add a new membership plan. Select the categories to make private in the ‘Restricted Product Categories’ field and save your settings
How to hide a category in WooCommerce – recap
In this article, we looked at methods to hide categories in WooCommerce, including:
- The default WooCommerce method
- Methods using user role, password, login status, or by specific users
- Programmatically hiding categories
The WooCommerce Members Only plugin lets you sell different products to different types of customers based on their user role or logged in status. It also gives you the option to show WooCommerce categories to people only after they enter the correct password.
Get the WooCommerce Members Only plugin today!