Home > Docs > Subscriptions for WooCommerce > Extending Subscription Length in Subscriptions for WooCommerce

Extending Subscription Length in Subscriptions for WooCommerce

Last updated on July 12, 2023

This article explains, how to extend the range of subscription lengths in Subscriptions for WooCommerce plugin. Utilizing a code snippet and making a few modifications allows extending the expiration date of subscriptions beyond the default settings. The article also discusses how to adjust the subscription lengths for days, weeks, months, and years.

Modify expiration date

  1. From the WordPress dashboard, navigate to Appearance > Theme File Editor > functions.php file.
  2. Copy the code snippet provided below.
  3. Paste the code snippet into the functions.php file.
  4. Modify the code snippet to add the desired subscription lengths.
  5. Save the changes to the function.php file.

Code snippet

Adjusting Subscription Lengths

By default, the plugin allows up to 24 months for monthly subscriptions, 90 days for daily subscriptions, 52 weeks for week-based subscriptions, and up to 5 years for year-based subscriptions.

Modify the subscription length using the code given below.

Days

To modify the subscription lengths for days, for example, extend the number of days for daily subscriptions from the default 90 days to 95 days. Include the lines:

Weeks

To modify the subscription lengths for weeks, for example, to add an 80-week subscription option, include the lines:

Months

To modify the subscription lengths for months, For example, to add a 25-month and 26-month subscription option, include the lines:

Years

To modify the subscription lengths for years, for example, to add a 10-year subscription option, include the lines:

Save the changes to the function.php file.