wp2shell: more than a month later. Confirm 6.8.6, 6.9.5, 7.0.2. Patched is not clean.

Read the advisory

WordPress password protected categories for WooCommerce

How WooCommerce Protected Categories (Barn2) restricts products by password, role, or user, plus security caveats and store hardening that still matter.

Topics WooCommerce & ecommerce Login & access

Lars Koudal

Lars Koudal

Updated Published

Not every product should be public. Wholesale pricing, VIP drops, employee stores, and age-sensitive catalogs need access control. WooCommerce does not ship rich category locks by default, so many stores use a dedicated plugin.

This post covers WooCommerce Protected Categories by Barn2: what it is good for, how setup usually works, and the security limits of “password on a category.”

Protect categories with WooCommerce Password Protected Categories

What the plugin is for

Barn2’s WooCommerce Protected Categories lets you restrict product categories so only the right people see (and buy) those items. Typical uses:

  • Wholesale or B2B catalogs
  • Member or subscriber collections
  • Private client selections
  • Soft-gated launches and staff-only SKUs

Access control for merchandising is not the same as full site security. It helps segmentation and pricing hygiene. It does not replace HTTPS, MFA, updates, or malware monitoring.

Key features (practical view)

Password protection

Assign one or more passwords to a category. Visitors enter the password before they see products. Simple for temporary campaigns. Shared passwords leak; rotate them when a campaign ends.

User role and individual user rules

Restrict by WordPress user roles (for example a wholesale role) or by specific accounts. Better for ongoing B2B than a single shared password.

Inheritance

Protect a parent category and subcategories/products generally follow. Mixed public/private assignments can create surprises if a product also sits in a public category. Test as a logged-out user and as each role you care about.

Options to keep protected categories out of menus, widgets, and search reduce casual discovery. Determined people may still guess URLs; treat hiding as UX, not cryptography.

Setup outline

Exact UI labels can change with plugin versions. The usual path:

  1. Purchase/download from Barn2, then Plugins → Add New → Upload and activate.
  2. Open WooCommerce → Settings → Protected Categories (or the plugin’s settings screen) and choose password, role, and/or user modes.
  3. Edit a category under Products → Categories, set visibility/protection, save.
  4. Test in a private window: guest, wrong password, correct password, and each relevant role.
  5. Share access only through channels you control (account invites, role assignment, private password delivery).

If anything fails after a cache plugin update, bypass or exclude protected archives from full-page cache and retest.

Protecting categories without shooting yourself in the foot

  • Prefer roles for long-lived wholesale access; use passwords for short campaigns.
  • Avoid putting the same SKU in both a locked and a fully public category unless you intend that.
  • Keep admin accounts on least privilege so staff cannot casually unlock catalogs.
  • Document who owns password rotation when people leave the company.

Customize the unlock experience lightly

A clear password form, sensible redirect into the category, and a human message for denied access reduce support tickets. Match brand colors if you want. Do not bury the unlock flow under dark patterns.

Security that still matters around protected catalogs

Category locks sit on top of a normal WooCommerce site. Harden the store too:

Password-protected categories reduce accidental exposure. They are not a substitute for server hardening or a WAF when bots and scanners hit the shop.

Testing and maintenance

  • Retest protection after theme, cache, and WooCommerce updates (staging first).
  • Rotate shared passwords on a schedule if you must use them.
  • Watch for plugin conflicts that expose restricted loops in sitemaps or feeds.
  • Remove access when a wholesale account ends.

Bottom line

WooCommerce Protected Categories is a practical way to gate wholesale, VIP, or private catalogs without building a second store. Use role-based access for lasting segments, treat shared passwords as temporary, and keep normal ecommerce security in place. Exclusivity helps merchandising. Patching, MFA, and honest payment architecture protect the business.

Found this useful? Share it.

Larger screenshot