How to Hide a WooCommerce Category from the Shop Page

Published on: Updated: November 1, 2018

Hide WooCommerce Category from Shop pageNeed 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 include any core functionality 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.

GET THE PLUGIN

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:

Customer review of WooCommerce Protected Categories plugin

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.

GET THE PLUGIN

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.

Filed under: WooCommerce Protected Categories, WordPress Plugins , ,