How to Hide WooCommerce Categories from Your Online Store: A Step-by-Step Guide

Have categories you don’t want to show in your WooCommerce store? Maybe you’re prepping a private launch. Or maybe you sell both wholesale and retail and want to keep certain products hidden from public view. Whatever the reason, hiding categories in WooCommerce is easier than you might think.

In this guide, we’ll walk you through several easy ways to hide WooCommerce categories from your storefront. You don’t need to be a coding wizard. Just follow the steps, and you’ll have full control over what shows up to your shoppers.

🔒 Why Hide WooCommerce Categories?

You might want to hide categories because:

  • You’re selling to different customer groups (like wholesale vs retail).
  • You’re staging new products for a big reveal later.
  • You want to test category layouts without showing them live.
  • You prefer a clean, focused storefront.

Whatever your reason, we’ve got the method for you. Let’s dive in!

🛠️ Method 1: Hide Categories from the Shop Page Only

Want to keep a category from showing on the main shop page, but still accessible via direct link? This is the best option for controlling front-page visibility without locking away the category completely.

  1. Go to Products > Categories in your WordPress dashboard.
  2. Find the category you want to hide.
  3. Note down its slug (you’ll need this in a second).
  4. Now, go to Appearance > Theme File Editor.
  5. Open the file named functions.php from your active theme.
  6. Add the following code snippet to the bottom of that file:
function custom_pre_get_posts_query( $q ) {
    if ( ! $q->is_main_query() ) return;
    if ( ! is_shop() ) return;

    $tax_query = (array) $q->get( 'tax_query' );

    $tax_query[] = array(
        'taxonomy' => 'product_cat',
        'field'    => 'slug',
        'terms'    => array( 'your-category-slug' ), // Replace with your category slug
        'operator' => 'NOT IN',
    );

    $q->set( 'tax_query', $tax_query );
}
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );

Important: Replace your-category-slug with the actual slug of the category you want to hide.

This neat piece of code tells WooCommerce to skip that category when loading the shop page.

🎯 Method 2: Use a Plugin (No Code Needed!)

Not a fan of code? No problem. There are plugins that do this for you with just a few clicks. We suggest using “WPC Product Categories Hider for WooCommerce” or “WooCommerce Catalog Visibility Options”.

Here’s how:

  1. Go to Plugins > Add New.
  2. Type in the plugin name and click Install.
  3. Click Activate.
  4. Follow the settings wizard or go to the plugin settings manually.
  5. Select the category you want to hide and choose visibility options (e.g., hide from users, search, catalog, etc.)

This is a great option if you want to hide based on user roles. So, for example, wholesalers can see one set of products while regular customers see something else.

Bonus tip: Some plugins even let you automate category visibility based on user login status. Smart, right?

🧱 Method 3: Hide a Category Using WooCommerce Shortcodes

WooCommerce gives you the ability to customize product display pages using shortcodes. If you want to create a custom shop page and manually leave out certain categories, this is the way to go.

Here’s how to replace the default shop page with one showing only specific categories:

  1. Create a new page (e.g., “Custom Shop”).
  2. Use this shortcode on the new page:
[products category="category-a, category-b"]

Only include the categories you want visible. Omit the one(s) you want to hide.

  1. Go to WooCommerce > Settings > Products.
  2. Under Shop page, set the new page you just created as your shop page.

Done! You now have full control over what categories show up.

♻️ Method 4: Hide a Category from Navigation Menus

Even if you hide a category from the shop page, it might still show in your menus. Let’s fix that.

  1. Go to Appearance > Menus.
  2. Find the category item you want to hide in the menu structure.
  3. Click the dropdown to expand and then select Remove.
  4. Save the menu.

That’s it! You’ve cleaned up your navigation and hidden your category from the menu.

👀 Bonus Tip: Hide Categories Based on User Roles

This is for store owners doing B2B and B2C business. You can hide categories for non-logged-in users or only show certain categories based on whether the user is a wholesaler or retailer.

To do this, we recommend using the plugin “Restrict Categories” or one of many “Role Based Pricing” plugins that come with category visibility options.

Steps:

  1. Install your chosen plugin.
  2. Go to the plugin’s settings.
  3. Choose the category you wish to restrict.
  4. Select which user roles can see it.
  5. Save changes and test! 🧪

When a non-authorized user tries to view the hidden category, they’ll get blocked—or redirected, depending on the plugin setup.

📋 Quick Recap

Let’s summarize what we’ve learned!

  • Use code to hide categories from the shop page.
  • Use plugins for quick, code-free solutions.
  • Create custom shop pages with shortcodes for full control.
  • Don’t forget to clean up your navigation menus!
  • Use user roles for next-level category hiding.

🚀 Final Thoughts

WooCommerce is flexible. You can show—or hide—whatever you want. You just need to know the tools and tricks. Whether you code it, click it, or use a plugin, your secret categories can stay secret until you’re ready to show the world.

So go on—launch that VIP collection. Run your wholesale deals. Hide that test category. With these methods, your WooCommerce store is fully under your control!

Happy hiding! 🎉