Restrict Content Pro

rcp_get_member_cancel_url()

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 a cancel URL for the given user’s primary membership (customer single membership), same query args as rcp_get_membership_cancel_url().

Deprecated in 3.0. Use rcp_get_membership_cancel_url( $membership_id ) when multiple memberships are enabled.

Parameters

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

Return values

(string) – Cancel URL, or empty string if there is no recurring membership.

Examples

$url = rcp_get_member_cancel_url();

if ( $url ) {
	echo '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Cancel subscription', 'rcp' ) . '</a>';
}
$customer = rcp_get_customer_by_user_id( $user_id );
$membership = $customer ? rcp_get_customer_single_membership( $customer->get_id() ) : false;
$url = $membership ? rcp_get_membership_cancel_url( $membership->get_id() ) : '';
Last updated: October 16, 2026
Was this page helpful?
Thanks for the feedback!