Offer special “members-only” products that require the user to have an active membership in order to purchase. The selected products can still appear in your Shop page or can be hidden from non-members. You can optionally add a second recipe to redirect users away from the single product page when membership requirements are not met.

About the Recipe

This customization recipe allows you to restrict the purchase of products in designated WooCommerce product categories for active members only. You now have full control over which categories require a membership in order to be purchased and which product categories (if any) are available to the public, regardless of their membership status.

This recipe can be used on its own or in conjunction with our WooCommerce Integration Add On, which offers additional features for integrating Paid Memberships Pro with WooCommerce.

Woocommerce product example

Some suggested use cases include:

  1. A shop that offers an array of products, some of which will only relate to members. This can include products like Membership-branded clothing or accessories, access to digital add-on products, specialized meal or diet plans and more. Basically, anything that you only want your members to be able to own and purchase.
  2. A shop that offers unique or special products that can entice users to sign up for a membership in order to purchase. This can be an added incentive to users thinking about signing up for your membership.
PRO TIP: Try to make your membership level/products as easy to sign up for and purchase as possible. A user may feel reluctant to join a membership only to be able to purchase a particular product. This can leave them feeling “forced” into something that they do not want to be a part of.Look at offering a lot of value for your membership packages and rather use this as an “added benefit” instead of a means to purchase a product.

The Code Recipe

This code recipe requires a PMPro Plus Account or higher.

View Membership Options

Comments (8)

Hey I wanted to add registration form before purchase in which user can select maximun m 2 categories and the user could see posts of those categories after purchase please help

How do i add multiple ID’s in this line?

if( pmpro_hasMembershipLevel() ) {

by comma? like

if( pmpro_hasMembershipLevel(1,4,6) ) {

Is it working well? I just published this cod, and all product are showing empty page now. It’s a bit disappointing as I upgrade to Pro version only for this option

Travis this snippet crashed my site! I took another look at your code recipe and saw that the “f” is missing from the word “function”. I fixed that and then it worked.

Hi Chanel,

Thank you so much for reaching out and so sorry about the silly mistake..

Despite our quality control, this one slipped past me. I have since fixed it up and everything should work fine now.

Thanks again for bringing this to my attention.

Leave a Reply

For faster support related to issues on your specific site please open a ticket in our members support area.

Your email address will not be published. Required fields are marked *