How to Hide a WooCommerce Category from the Shop Page

Last Updated: June 22, 2020 16 comments

Need to hide a WooCommerce category from the shop page? Sometimes you might have products that you don’t want to publicly list on your shop page. To your dismay, though, WooCommerce doesn’t have an option to hide categories from the shop page.

To help, we’re going to show you how you can hide one or more categories from your WooCommerce shop page via a user-friendly plugin.

Our simple written instructions and video will show you how to customize how your hidden WooCommerce categories function – all without writing a single line of code.

WooCommerce school category visibility

The best plugin to hide a WooCommerce category from the shop page

The problem

There are lots of reasons why you might want to hide WooCommerce categories from the main shop page. For example, maybe you’re creating a WooCommerce wholesale store and need to hide the wholesale categories from the shop page. Maybe you’re selling customer-specific products, with a hidden category for each company.

Whatever you’re reason, unfortunately WooCommerce doesn’t come with an option to do this.

While it is possible to use a PHP function to hide a WooCommerce category from the shop page, that solution:

  • Isn’t very user-friendly because it requires you to work directly with PHP code, rather than a human-friendly interface.
  • Makes it difficult to change which categories are hidden later on, because you’ll need to dive back into the code every time you want to make an adjustment.

The solution

WooCommerce Protected Categories offers a simpler solution to hide a WooCommerce category (including all products/subcategories inside). It:

  • Gives you more flexibility than the WooCommerce PHP function in terms of how shoppers interact with your hidden categories.
  • Lets you choose which categories to hide right from your WordPress dashboard.
  • Lets you decide whether to hide categories from the shop page completely, or whether to show them but require customers to enter a password or login to access a protected category or its products.

WooCommerce Protected Categories
Start hiding WooCommerce categories from the shop page today.

The plugin lets you hide unlimited categories from your WooCommerce shop page. To let people unlock a hidden category, you can choose between:

  • Requiring users to enter a password before they can see the hidden category (or categories).
  • Only allowing logged in users with specific roles to see the hidden categories.
  • Only allowing specific individual users to see the hidden categories.

The plugin also offers more advanced functionality, like whether or not to still list your hidden categories in navigation menus or sidebars.

Have a read through this glowing review from a happy customer using the WooCommerce Protected Categories plugin:

Excellent plugin!
By Timothy
I highly recommend Barn2's 'WooCommerce Password Protected Categories' plugin for a whole range of uses. For our particular use, we needed to allow only certain categories of our products to be accessed by 'select' customers, with a shared password. The plugin enabled us to do this really simply and cost-effectively. Whenever we have needed any assistance with the plugin Barn2's team have been very helpful and prompt with their replies. I'm sure this is a decision you won't regret.

Below, we’ll show you how to hide a WooCommerce category from the shop page using WooCommerce Protected Categories.

Step 1: Choose which categories to hide

Once you’ve installed and activated WooCommerce Protected Categories, go to Products → Categories to choose which categories to hide from the shop page.

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. Click the ‘Protected’ option, and choose between:

  • Unlock WooCommerce category for logged in usersPassword protected Visitors will need to enter a password to see the category. You can create multiple passwords to unlock the category if desired.
  • User roles Your category will only be visible to certain user roles.
  • Users Your category will only be visible to the users that you select here.

Once you’ve hidden one or more categories via either method, go to WooCommerce → Settings → Products → Protected categories to configure a few more basic settings.

Step 2a: Configure settings for your WooCommerce protected categories

One especially important group of settings is Category Visibility.

If you want to completely remove a Woo category from the shop page, you should uncheck both boxes. Alternatively, tick both boxes to still display the category, but require users to enter a password or login to see its contents.

Use the other settings to control your password login form, and what happens when a logged out user tries to access a protected category:

WooCommerce Protected Categories Visibility Settings

How can people access my hidden categories?

Once you’ve hidden categories from the WooCommerce shop page, you’ll want to provide other ways for selected customers to access them. There are a few ways to do this, depending on how you plan to use your hidden categories and products:

  • Providing access to WooCommerce password protected categories:
    • Create a central category login form by adding the shortcode [category_login] to any page. Customers will be directed to the hidden category with the password they have entered. Once unlocked, the customer will be able to see the protected category and products on the main Woo shop page. The protected content will remain hidden from everyone else.
    • Tick the ‘Catalog Visibility’ option on the plugin settings page so that the hidden categories and products do appear on the WooCommerce shop page, but customers must enter a password to access the content within.
    • Tick the ‘Catalog Visibility’ option to show the hidden categories and products in menus and widgets. For example, this will allow you to add menu links to your hidden categories, and to show the hidden products in WooCommerce ‘Products’ widgets.
  • Providing access for user or role protected WooCommerce categories:
    • User and role restricted categories and their products will automatically appear when a customer with the correct privileges logs into their user account. The hidden categories and products will then appear everywhere in your store, such as the main WooCommerce shop page, in navigation menus and widgets. The hidden categories will remain invisible to all other users.
    • If you want to automatically redirect users to a specific category when they log into their account, then we recommend the free Peter’s Login Redirect plugin. This lets you choose where specific roles or users are forwarded after logging in.

Don’t mess with code, just use WooCommerce Protected Categories

With WooCommerce Protected Categories, you can hide a WC category from the shop page in just a couple minutes without writing a single line of code. Do this for as many product categories as you like.

For more information, you can see a live demo or consult the detailed documentation.

WooCommerce Protected Categories
Start hiding WooCommerce categories from the shop page today.

And if you have any other questions about how to hide a WooCommerce category from the shop page, leave a comment and we’ll do our best to help.

Colin Newcomer

Colin Newcomer is a freelance WordPress writer for hire with a background in SEO and affiliate marketing. He helps clients grow their web visibility by writing primarily about digital marketing and WordPress. You can hire him to write for your website.

16 Comments

  1. David
    June 17, 2020 Reply

    Hello,
    i have purchased this plug-in but i have an issue... when i hide a category(private), all the products wich also belong to a public category disappear in these public categories.
    My question is, is it possible to hide a category and display some products of the same category somewhere else?

    • Ron Silvosa
      June 17, 2020 Reply

      Hi David, thanks for your inquiry. All products inherit the protection applied to the category.

      In your case, the product will be private. The product can only be unlocked by a user who is logged in and has privileges to view private products (normally Administrators and Store Managers).

      It is advisable that you create a copy of the product using the Duplicate Post plugin which makes it easy to clone WooCommerce products.

      This way, you can set the duplicate product in the other non-private category as its separate product.

      I hope this helps. Let us know if you have further questions.

  2. Ciaran Meagher
    April 3, 2020 Reply

    Hi
    We are designing a WooCommerce store for a Paint and Wallpaper store. The 2 "top" level categories are "Paint" and "Wallpaper" - both have numerous sub-categories (Brand / Collection / Colour etc).
    What I am trying to achieve is the one of my shop pages will be purely for displaying Paint (and its sub categories) only, and another page displaying Wallpaper (and its sub categories) only, but without the requirement for customers to enter a password.

    In simple terms, I need the flexibility of hiding certain categories on certain pages, and displaying them on another, without password entry.

    Do you have a solution fo rthis?

    Kind regards

    Ciaran

    • EJ
      June 3, 2020 Reply

      Hi, Ciaran. Thanks for your comment and my apologies for the late reply.

      If I understand correctly, I believe what you would like to have are categories that are private/protected/hidden on some pages whilst public on others.

      Please note that there is no grey area in hiding/protecting categories. A public category will be public anywhere on the site and a hidden/protected category will not be public anywhere on the site.

      As a workaround for what you would like to achieve, I suggest you instead have 2 identical categories, each with their identical copies/set of products. One will be the public version of the category and its products and the other the hidden/protected one. This way you can decide whether to display the public or the protected category version on your pages.

      You can easily create copies of your products using the free Duplicate Post plugin + use the Group Stock Manager plugin to allow you to share stock quantity between the duplicate products in each category (to help you track inventory across the duplicates).

      I hope this makes sense and helps. Should you have any other questions, you can get in touch with us much sooner via our dedicated Support Center.

      Best regards and keep safe.

  3. Mark
    January 24, 2020 Reply

    Hi, I am looking at purchasing the protected categories plugin. We don't want to show the category 'sold' in our store. But on a separate page we do want to show the 'Sold' stock. Is this plugin the right choice for us?

    • EJ
      March 4, 2020 Reply

      Hi, Mark. Thanks for your comment and sorry for the late reply here. I believe you also sent a similar enquiry via our Support Center, which we replied to right away. For those who might have a similar concern, I'm including my reply below:

      You can hide a category from being publicly visible on your shop page by making the category protected (See: Password protected, user and role protected categories) and then ensuring that the Category Visibility options in the plugin settings are not enabled/checked/ticked.

      The category page or category archive page would be where you can show the protected category and the products it contains. When going to the category's address or URL, users who have the password or have access to the category via User or User Role protection will need to log in. To allow for this, you should set the When logged out page to be either your site's WordPress login page or a custom page, which should be a central password login page.

Please share your thoughts...

Your email address will not be published.