Hide WooCommerce Product Variations by User Role using a plugin

WooCommerce product variations let you sell a single product in multiple configurations as different sizes, colours, materials, or tiers.

But sometimes not every variation should be available to every customer.

In this guide I show you how to hide specific WooCommerce product variations from certain user roles using my plugin, without coding.

The plugin you need

I’ve developed Hide Products by User Role for WooCommerce, a plugin that supports variation-level visibility natively.

I wrote more information on plugin’s page.

You can install from wordpress.org/plugins/riaco-hide-products-by-user-role-for-woocommerce, so give it a try.

Hide a variation from a user role

Follow these step-by-step instructions to hide specific product variations from a user role in WooCommerce.

Open the variable product

In WP Admin, go to Products and open the variable product that has the variation you want to restrict.

Go to the Variations tab

In the Product data panel, click Variations.

Expand the variation

Click the arrow next to the variation you want to hide to expand its settings panel.

Find the “Hide for Role” tab on the left.

Inside the variation panel you will see a Hide this variation for section listing all WordPress roles plus Guest.

Check every role that should not see this variation.

Save

Click Save changes on the variation, then click Update on the product.

Let’s implement a common setup

Let’s implement a common setup: public product, members-only variation.

Suppose you sell a product in three sizes: small, medium, and large.

Small and medium are available to everyone. Large is a bulk size available only to wholesale customers.

Our setup will be:

  1. Open the Large variation.
  2. Check Guest and Customer (your standard retail role) in the Hide for roles section.
  3. Save.

Now guests and standard customers see Small and Medium in the dropdown. Wholesale customers see all three.

Combining variation hiding with product-level rules

Variation hiding and product-level hiding work independently:

  • If the parent product is hidden from a role, the variation is also hidden (no customer reaches the product page).
  • If the parent product is visible but a specific variation is hidden, the customer sees the product but not that option.

Use both together for precise control.

What happens to a hidden variation?

When a variation is hidden from a role:

  • It does not appear in the variation dropdown on the product page for that role.
  • It does not appear in REST API responses for that role, which is important for block themes and headless storefronts.
  • If the variation was the only option available to that customer, the product page still shows (the product itself is not hidden) but with no selectable variation. Consider also hiding the parent product from that role if this creates a poor UX.

Does it work with “All Variations” selects?

Yes. The plugin filters woocommerce_available_variation which is the hook WooCommerce uses to build the variation data object sent to the browser.

Hidden variations are removed from the JSON payload before the page renders, so they cannot be selected even if a customer inspects the page source.

Does it work with the REST API?

Yes. The REST API variation endpoint also respects the visibility rules, so apps and headless storefronts get the same filtered variation list.

Why hide individual variations?

You may need visibility variation-level control for this common cases:

  • Show the standard 100ml to all customers, but hide the professional 1L from the public.
  • Show standard colours to guests, but reserve custom colour options for registered trade accounts.
  • Hide a legacy size from new customers while keeping it available for existing accounts to reorder.
  • Offer a bulk pack variation only to users with a wholesale role.

Get the plugin

If you need variation visibility control, per-role, download Hide Products by User Role for WooCommerce, there is a free version on WordPress.org.

More posts