Restrict Content Pro

rcp_get_content_subscription_levels()

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 membership level requirements stored on the post (rcp_subscription_level post meta from the Restrict this content metabox). It does not read post-type-wide rules or term restrictions. For a combined view that can include post-type defaults, use rcp_get_post_restrictions().

Parameters

$post_id (int) – Post ID. Default: 0.

Return values

(array|false|string) – One of:

  • false – Legacy value when meta is all (treated as no level restriction).
  • 'any' – Any membership level.
  • 'any-paid' – Any paid membership level.
  • (array) – One or more membership level IDs.
  • Empty or other falsey values when no level restriction is set on the post.

Examples

$levels = rcp_get_content_subscription_levels( get_the_ID() );

if ( 'any-paid' === $levels ) {
	// Restricted to any paid level.
}

if ( is_array( $levels ) && in_array( 3, $levels, true ) ) {
	// Level #3 is required.
}
$levels = rcp_get_post_restrictions( get_the_ID() );
// Use membership_levels key when you need post-type rules included.
Last updated: October 14, 2026
Was this page helpful?
Thanks for the feedback!