Restrict Content Pro

rcp_set_expiration_date()

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

Sets a new expiration date for a given user.

This function has been deprecated since Restrict Content Pro 3.0. For new code, use RCP_Membership::set_expiration_date() on a membership record. See also rcp_get_expiration_date().

Parameters

$user_id (int) (optional) – The ID of the user to set the expiration date for. Set to 0 to use the currently logged-in user.

$new_date (string) – The new expiration date to set. Pass as a MySQL date string (for example, YYYY-MM-DD HH:MM:SS).

Return values

bool – true if the expiration date was updated, false if it was not.

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