Restrict Content Pro

rcp_delete_discount()

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

Permanently deletes a discount code from the database.

Action: rcp_delete_discount (before delete).

Parameters

$discount_id (int) – Discount ID.

Return values

(bool) – Result of the delete query.

Examples

if ( rcp_delete_discount( $discount_id ) ) {
	// Discount removed.
}
$discount = rcp_get_discount( $discount_id );
if ( $discount ) {
	rcp_delete_discount( $discount->get_id() );
}
Last updated: October 30, 2026
Was this page helpful?
Thanks for the feedback!