WooCommerce Memberships Setup
WooCommerce Memberships is a plugin for creating paid or free closed sections of a website. It does not process payments directly — it manages access control. Payments are handled through WooCommerce (regular products) or WooCommerce Subscriptions (recurring payments).
Plugin Architecture
Three key objects:
- Membership Plan — a membership tier with access rules: which content, what discounts, what features
- User Membership — a specific membership instance for a user: plan, start date, end date, status
- Membership Content Rules — rules like "hide/restrict access to a post/category/content type for everyone except members of plan X"
Data is stored in wp_posts (type wc_user_membership) and wp_postmeta.
Creating a Membership Plan
WooCommerce → Memberships → Membership Plans → Add New
→ Name: "Pro Member"
→ Access Length: Unlimited / Fixed (X days) / Subscription-tied
After creating the plan, there are three configuration tabs:
Restriction Rules — what to hide from non-members:
- Individual post/page/CPT
- Entire post type
- Taxonomy (category, tag, custom)
- Content inside a post via shortcode
[wcm_nonmember_content]
Purchasing Discounts — member discounts in the store:
- Percentage or fixed amount for specific products / categories
- Applied automatically when added to cart
Members Area — what to show in a member's account (sections: My Membership, My Profile, Members Discounts, etc.)
Linking to a WooCommerce Product
Membership is granted upon purchase of a specific product. The link is set on the product page, Linked Memberships tab:
Product "Annual Pro Access" → Linked Membership Plan: Pro Member
Grant access: upon purchase / upon order completion
One product can grant multiple plans. One plan can be linked to multiple products with different prices.
Integration with WooCommerce Subscriptions
If membership is tied to a subscription, it automatically pauses when the subscription is paused/cancelled and resumes upon successful renewal. This is configured through Tied to a Subscription in the plan settings.
Restricting Content via PHP
// Check if current user is an active member of a plan
if ( wc_memberships_is_user_active_member( get_current_user_id(), 'pro-member' ) ) {
// show restricted content
}
// Get all active memberships for a user
$memberships = wc_memberships_get_user_active_memberships( $user_id );
foreach ( $memberships as $membership ) {
echo $membership->get_plan()->get_name();
echo $membership->get_end_date();
}
Drip Content (Delayed Access)
Memberships supports "drip" access — content opens N days after membership activation:
Content Rule → Delay access: 7 days after membership start
Used for online courses: lesson 1 immediately, lesson 2 in 7 days, lesson 3 in 14 days.
Bulk Member Import via CSV
When migrating from another system or bulk granting access:
WooCommerce → Memberships → Members → Import
CSV format: user_email, plan_slug, start_date, end_date
Or via WP-CLI:
wp wc memberships member create \
--user_id=42 \
--plan_id=15 \
--status=active
Custom Statuses and Hooks
// Action when a new membership is activated
add_action( 'wc_memberships_user_membership_status_changed', function( $user_membership, $old_status, $new_status ) {
if ( 'active' === $new_status ) {
// send welcome email, create CRM entry
send_crm_event( $user_membership->get_user_id(), 'membership_activated' );
}
}, 10, 3 );
Manual Verification Checklist
Caching is the enemy of Memberships. If the site uses WP Super Cache, W3 Total Cache, or Varnish, restricted content may be cached and shown to unauthenticated users. Solution: either exclude pages with protected content from cache, or switch to fragment caching and don't cache for logged-in users.
SEO plugin conflicts: Yoast and RankMath sometimes index metadata from restricted pages. Setting noindex for pages with limited access is a separate step.
Timeline
One plan with basic restriction rules and product linking — 1–2 business days. Multiple plans with different access levels, drip content, Subscriptions integration, and bulk import of existing memberships — 3–5 days.







