If you’ve restricted a product to specific wholesale roles using WooCommerce Wholesale Prices Premium, you may notice that visitors without the right role can still find that product in your site’s search results, even though they can’t open its page. This is expected. The wholesale role restriction blocks access to the product page itself, but it doesn’t remove the product’s title or excerpt from WordPress’s built-in search or from WooCommerce’s Product Search widget.
When someone without the required wholesale role tries to open a restricted product’s page (or a restricted product category page), WooCommerce Wholesale Prices Premium redirects them straight to the shop page. That protection applies no matter how they arrived there, whether from a search result, a direct link, or a bookmark. If you also want restricted products to disappear from search results entirely, you can combine the role restriction with WooCommerce’s own catalog visibility setting, covered below.
Requirements
- WooCommerce Wholesale Prices Premium installed and activated.
- At least one product with a wholesale role restriction already configured. If you haven’t set this up yet, see How to adjust visibility of wholesale products.
How restricted products are protected
Each product has a Restrict To Wholesale Roles field in the Publish box on the product edit screen, where you choose which wholesale roles are allowed to view it. Products restricted this way are correctly excluded from your shop page and product category listings for anyone without the required role.
Restricted products are not filtered out of your site’s search box or the WooCommerce Product Search widget in the same way. Both of these list matching products by title, independently of the wholesale role restriction. The restriction only takes effect once a visitor opens the product page directly, at which point they are redirected to the shop if they don’t have the required role. In practice, a restricted product’s title can turn up in a search results page, but clicking through to it never exposes the product page, price, or add-to-cart button to an unauthorized visitor.
Hiding restricted products from search results too
If you don’t want a restricted product’s title appearing in search results at all, pair the wholesale role restriction with WooCommerce’s Catalog visibility setting on that product.
- Open the restricted product for editing.
- In the Publish box, click Edit next to Catalog visibility.
- Select Shop only to keep the product visible on the shop and category pages but excluded from search, or Hidden to exclude it from both.
- Click OK, then Update the product.

Catalog visibility isn’t role-aware. It applies to every visitor equally, including wholesale customers who do have permission to view the product. If those customers need to find the product through search, they’ll need a direct link or a category page instead, since it will no longer appear as a search result for anyone.
Troubleshooting
I found an old code snippet that’s supposed to add products back into search results. Does it still work?
No. That snippet hooked into WordPress’s pre_get_posts action to re-add the product post type to search queries. Current versions of WooCommerce Wholesale Prices Premium no longer use pre_get_posts for this, and WooCommerce itself doesn’t run product-specific query filtering during a search request. The plugin now filters products on WooCommerce’s own woocommerce_product_query hook, which only runs for product queries such as the shop page and category pages. A plain site search is not a product query, which is why search results are not filtered. The snippet has no effect in current versions and you can remove it if you added it before.
A wholesale customer says they can’t find a product they know exists
Check whether the product’s Catalog visibility is set to Shop only or Hidden. Both settings remove the product from search for every visitor, including wholesale customers who are otherwise allowed to view it. Also confirm the customer’s wholesale role is included in the product’s Restrict To Wholesale Roles list.
I changed a product’s restriction or catalog visibility, but the change isn’t showing up on the frontend
Clear any full-page or object caching on your site. Search results and shop pages are often cached separately from the product itself, so a visibility change may not appear until the relevant cache is cleared or expires.
Frequently asked questions
Do administrator or shop manager accounts see restricted products differently?
Administrators and shop managers bypass the wholesale role restriction entirely, so they can always view a restricted product’s page regardless of role. Catalog visibility, on the other hand, is a native WooCommerce setting and behaves the same for every logged-in user browsing the frontend, including administrators.
Is the “Only Show Wholesale Products To Wholesale Customers” setting the same feature?
No, that’s a separate setting. It hides products that don’t have a wholesale price set for the customer’s role, and only affects wholesale customers. It doesn’t control whether a wholesale-restricted product is visible to guests or other roles, which is what this article covers.
Does restricting a product category work the same way as restricting a single product?
Yes. Visitors without the required wholesale role are redirected to the shop page if they try to open a restricted product category page directly, the same way they are for a restricted single product page.
Does this affect how the product is indexed by Google or other search engines?
No. Both the wholesale role restriction and catalog visibility only affect your own site’s search box and the WooCommerce Product Search widget. Neither controls whether external search engines index the product page. If you need to prevent that, use the noindex setting in your SEO plugin instead.
Can I send unauthorized visitors somewhere other than the shop page?
The shop page is the default redirect destination. A developer can change it using the wwpp_wholesale_role_visibility_filter_redirect_link filter. Reach out to our support team if you’d like help customizing this.
Does the role restriction apply to product variations?
Yes. The restriction is set on the parent product, so it covers the product’s page as a whole, including all of its variations.
Help & support
We have a dedicated support team for Wholesale Suite who knows our products, WooCommerce, and the industry very well. You’re welcome to make use of their expertise at any time, worldwide.
If you are an existing customer please go to the support ticket request form and send us a message.
If you are a free plugin user, please send us a support request on the forum. We actively monitor the WordPress.org support forums for the free plugin and help our users there as best as we can.
