Restrict Content Pro

rcp_can_member_cancel()

Coming soon: Restrict Content Pro is becoming Kadence Memberships. You may see both names used while we update the product, documentation, and customer experience.

Note: This content is provided as a resource within our developer documentation. Because custom code requires highly specific implementation, we encourage you to work with a qualified developer if you need guidance. You can find our recommended consultants here: https://codeable.io/developers/restrict-content-pro

Returns whether the user can cancel auto-renewal from the site (front-end cancel link/gateway cancellation).

Deprecated in 3.0. Prefer rcp_can_membership_be_cancelled( $membership_id ) or RCP_Membership::can_cancel() when you know the membership record. This wrapper uses RCP_Member and the customer’s primary membership (same pattern as legacy single-membership sites).

Cancellation is allowed only when the membership is recurring, status is active, paid, not expired, and the gateway supports on-site cancellation (Stripe, PayPal with API access, Braintree with API access, 2Checkout with credentials, and similar). Filter: rcp_membership_can_cancel.

Parameters

$user_id (int) – User ID. Default: 0 (current logged-in user).

Return values

(bool) – true if the member can cancel; false otherwise.

Examples

if ( rcp_can_member_cancel() ) {
	// Show cancel subscription link for the current user.
}
$membership = rcp_get_customer_single_membership( $customer_id );
if ( $membership && rcp_can_membership_be_cancelled( $membership->get_id() ) ) {
	// Preferred when you have a membership ID.
}

Related: Canceling Memberships, rcp_get_membership_cancel_url().

Last updated: October 16, 2026
Was this page helpful?
Thanks for the feedback!