WooCommerce Subscriptions - Renewal Only Coupon
Need to offer customers a coupon that will only discount a manual renewal payment? Now you can!
by Prospress Inc. · github.com/prospress/woocommerce-subscriptions-renewal-only-coupon · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/prospress/woocommerce-subscriptions-renewal-only-coupon/archive/refs/heads/master.zipReadme
IMPORTANT: This code is made available in the hope that it will be useful, but without any warranty. See the GNU General Public License included with the code for more details. Automattic or WooCommerce support services are also not available to assist with the use of this code.
WooCommerce Subscriptions - Renewal Only Coupon
Need to offer customers a discount that can only be applied to a manual renewal?
Now you can!
Renewal Only Coupons makes it possible to create WooCommerce Product or Cart coupons that can only be applied to renewal payments, not initial sign-ups, by customers via the cart.
To define the coupon codes that should be renewal only, either:
- Enter the coupon codes via the administration settings screen; or
- Use custom code to set them via the
WCS_RENEWAL_ONLY_COUPON_CODESconstant orwcs_renewal_only_coupon_codes'filter
Store managers can still apply Renewal Only coupons to any order or subscription. Customers can only apply them to renewal order payments.
Example error when attempting to apply a Renewal Only coupon to a new sign-up:

Usage
Step 0: Create a Coupon
To create a coupon:
- Go to WooCommerce > Coupons > Add Coupon
- Click Discount Type
- Click either:
- Recurring Product Discount or 1.Recurring Product % Discount
- Complete other coupon fields
Note: For best results, we recommend using either a Recurring Product Discount or Recurring Product % Discount discount type.
These discount types can be applied to subscriptions via the WooCommerce > Edit Subscription administration screen, while others, like Fixed cart or Fixed product discount types can not be applied to subscriptions.
Other discount types may also yield unexpected behaviour, for example, the Sign Up Fee discount type will not discount any part of a renewal payment, because it only discounts the sign-up fee component of an order, of which there is none on a renewal.
Option 1: Enter Coupon Codes via Subscriptions Settings
- Go to WooCommerce > Settings > Subscriptions
- Scroll to the Renewals section
- Click the Renewal Only Coupons text field
- Enter a coupon code to restrict to renewal payments only
- If additional coupon codes are requireed, enter a comma (
,) before each additional code

Option 2: Define Coupon Codes in Class Constant
define( 'WCS_RENEWAL_ONLY_COUPON_CODES', array( 'coupon_code_one', 'hallowoon', 'cyber_monday' ) );
Option 3: Define Coupon Codes via Filter
function eg_my_renewal_only_coupon_codes( $existing_codes ) {
$existing_codes[] = 'my_new_code';
$existing_codes[] = 'my_other_new_code';
return $existing_codes;
}
add_filter( 'wcs_renewal_only_coupon_codes', 'eg_my_renewal_only_coupon_codes' );
Installation
To install:
- Download the latest version of the plugin here
- Go to Plugins > Add New > Upload administration screen on your WordPress site
- Select the ZIP file you just downloaded
- Click Install Now
- Click Activate
Updates
To keep the plugin up-to-date, use the GitHub Updater.
Requirements
This plugin requires:
- PHP 5.6 or newer
- WooCommerce 3.2.0 or newer
- WooCommerce Subscriptions 2.4.0 or newer
Reporting Issues
If you find an problem or would like to request this plugin be extended, please open a new Issue.