How to add subscriptions to simple and variable products in WooCommerce?

Featured, WooCommerce, WordPress
How to add subscriptions to simple and variable products in WooCommerce?

How to add subscription plans to your existing products on WooCommerce?

How can I set this up so customers can purchase the product one-time as well as see the options to subscribe every month, every 2 months, or every 3 months? All on one product page?

In this guide, you will learn best practices for setting up the All Products for WooCommerce Subscriptions extension on your WooCommerce site.

Let’s begin!

How to setup All Products for WooCommerce Subscriptions?

  1. Download and activate WooCommerce Subscriptions and All Products for WooCommerce Subscriptions plugins
  2. Copy/paste code snippets into functions.php
  3. Copy/paste styles into style.css file
  4. Copy/paste this code snippet below and override the product-subscription-options.php template file
  5. Add subscription to existing products
  6. Make sure payment methods work and do a test checkout

Step 1. Download and activate WooCommerce subscription plugins

The first step is to purchase, download and activate the following plugins on your WooCommerce store:

Yes, I know these are paid plugins but will save a lot of time and ensure that your subscriptions are setup and working correctly.

Before going to Step 2, make sure both plugins are not only installed but also activated. I also would recommend taking a backup of your site as well as testing this on a staging site.

Step 2. Copy/paste code snippets into functions.php

  1. First, go to your active WordPress theme via FTP or SSH.
  2. Next, open up the functions.php file.
  3. Then, add this code snippet to the bottom of your functions.php file.
  4. Save your file.

The file path will be [your-active theme]/functions.php.

View functions.php code snippet.

Step 3. Copy/paste styles into style.css file

  1. First, go to your active WordPress theme via FTP or SSH.
  2. Next, open up the style.css file.
  3. Then, add these styles to the bottom of your style.css file.
  4. Save your file.

The file path will be [your-active theme]/style.css or whatever styling sheet you use for your theme.

View style.css additions.

Step 4. Override the product-subscription-options.php template file

To get this functionality, you will need to rewrite file product-subscription-options.php.

  1. First, go to your active WordPress theme via FTP or SSH.
  2. Next, create a ‘woocommerce’ folder inside your active WordPress theme if you have not already. This will allow you to override WooCommerce files.
  3. Then, inside the /woocommerce/ folder, create another folder called ‘single-product’.
  4. Next, create a file inside your /woocommerce/single-product/ folder called product-subscription-options.php.
  5. Copy the code snippet and paste into product-subscription-options.php. Save your file.

The file path will be [your-active theme]/woocommerce/single-product/product-subscription-options.php.

View code snippet

Step 5. Add subscription to existing product

Next, on your WooCommerce dashboard, navigate to Products and choose a product you want to offer a subscription.

Edit the product, scroll down to the Product Data section, and click the “Subscriptions” tab.


Then, click “Add Plan” to add your subscription plans.


For example, in my store, I want to offer a subscription on a product with the following intervals:

  • Every month
  • Every two months
  • Every three months

Because subscriptions mean more recurring revenue, I’m going to offer my customers 10% off if they choose a subscription. See the screenshot below for how my setup looks like:


Finally, I’m going to click “Save” and view my product on my store.

When I navigate to my product page, I see the one-time option as well as the subscription options.


Congrats! You have setup a subscription for an existing product.

Step 6. Check payment methods and do test checkout

First, navigate to WooCommerce > Settings and click the “Payments” tab.

Next, look at the Automatic Recurring Payments column. Does your current payment methods support subscriptions?


If you are using Stripe, it automatically supports subscriptions.

Then, go back to your shop and go to a product page where you are offering a subscription.

Choose a subscription option you have setup and go through the Checkout process and complete a test order.

Did everything come through correctly?

Finally, navigate back to the backend of your WooCommerce store and click “Orders”.

Because this was the first subscription order you created, you should see the parent order icon.

Reference the screenshot below for the difference between the parent order icons and the renewal order icons.


Video Tutorial

If helpful, I also created a video that goes through this process.

If you have not setup WooCommerce Subscriptions, see this video to learn how!


So there you have it. That’s how you apply subscriptions to existing products on your WooCommerce store.

After setting up subscriptions on your store, let your customers know that you now offer subscriptions. Not only is this a good excuse to send a marketing email but a lot of your customers will be thrilled to know they do not have to worry about running low or out of your product!

If you would like to reference how the subscriptions are setup on a store, take a look at the sample product I setup here: sample product

Pro tip: before publishing this live on your store, ensure you have gone through the “Subscriptions” tab in the WooCommerce Settings.


  1. Ollie August 15, 2019 | 1:04 am

    Hi – I left a comment on your youtube channel asking how to have a drop down box to select frequency of shipping and a hover Tooltip for information. Can you please send me instructions on how to do this? It would be greatly appreciated! Regards, Ollie

  2. Ollie September 3, 2019 | 9:16 pm

    Hi There,

    Is it possible for you to please provide me with the appropriate code to install the dropdown option on the subscription frequency, as shown in your youtube video?

    Regards, Ollie

    • Simon Gondeck September 16, 2019 | 12:21 pm

      Hi Ollie, I posted the code snippet in the blog post. You will need to paste this into your active WordPress theme with the file path: [active theme]/woocommerce/single-product/product-subscription-options.php. Thanks!

  3. MIke September 18, 2019 | 10:32 am

    Hey Ollie, will your solution work for this scenario?
    I have a product with 3 different quantities (30pack, 60pack, 90pack).
    I’d like to offer a one time purchase for each as well as 2 subscription options for the 60 and 90 pack (every month, every 2 months)
    is this possible with your code above?


  4. Enamul Haque October 17, 2019 | 12:52 pm

    Hi I have followed your instruction and but it is showing an error. could you please check it. note:

    : Uncaught Error: Call to undefined function get_company_name() in /woocommerce/single-product/product-subscription-options.php:119
    Stack trace:
    #0 plugins/woocommerce/includes/wc-core-functions.php(249): include()
    #1 plugins/woocommerce-subscribe-all-the-things/includes/display/class-wcs-att-display-product.php(166): wc_get_template(‘single-product/…’, Array, false, ‘/home/customer/…’)
    #2 wp-content/plugins/woocommerce-subscribe-all-the-things/includes/display/class-wcs-att-display-product.php(249): WCS_ATT_Display_Product::get_subscription_options_content(Object(WC_Product_Simple))
    #3 wp-includes/class-wp-hook.php(286): WCS_ATT_Display_Product::show_subscription_options(”)
    #4 /home/customer/www/divinohair in

  5. Dale October 28, 2019 | 5:52 pm

    Hey Simon, thanks for the guide on this. I’ve been trying to accomplish having monthly subscription and one off orders on single product pages without any luck.

    I have tried using your code snippet on my child theme but I am receiving this error:

    “The site is experiencing technical difficult”


    Would love to get some feedback, maybe the code works for a certain version of the plugins?

  6. Ryan November 4, 2019 | 10:04 pm

    Hi Ollie and Simon,

    Copying the code via ftp just as you said actually just causes an error and the page does not display at all. Is this dependent on what them or product template builder (elementor) is installed? I’d really like to implement this!

    Thank you

  7. Rocky November 5, 2019 | 6:58 pm

    Hi simon,
    After add that code in my child theme in this folder
    I got error
    could you please help?

  8. parin January 7, 2020 | 6:31 am

    I have added your code in my child theme but site break and showing site technical difficulty issue.
    I have checked and added your code in my wordpress site but site is showing like this ( and I have this plugin

    1. woocommerce subscription

    Please Help me to fix this issue.

    Thanks and Regards

    • Simon Gondeck April 5, 2020 | 1:34 am

      Hey Parin! I finally had a chance to update these snippets. Could you try again and see if you can get working on your site?

  9. Cat Russell January 12, 2020 | 4:24 am

    I really loved the look of this but it is causing an error on my site also as reported by some other people.
    Any ideas what the issue could be?

    • Simon Gondeck April 5, 2020 | 1:33 am

      Hey Cat! I finally had a chance to update these snippets. Could you try again and see if you can get working on your site? Thanks!

  10. Scott April 6, 2020 | 4:18 pm

    Hi the discount is not being applied in the cart after the subscription is added. Also the reoccurring payment notice is not being displayed in the cart. Ive create the directories and files step by step. Thanks!

  11. Ivan May 16, 2020 | 1:15 am

    Didnt work for me. Website didnt break, but also didnt get subscription tab in my single products

  12. GRIFFIN July 1, 2020 | 11:54 pm

    My Product price is getting injected with save XXXX every xx months and its duplicating is there a way to fix this? I also offer memberships on my site and they are tied to specific products, is there a way to turn off the subscribe section for people who are already members?

  13. Michael July 10, 2020 | 1:03 pm

    This might be an odd question, but what exactly is the need to add functions and snippets provided. You don’t really ever explain what they are for. Your video for “All Products for WooCommerce Subscriptions” doesn’t mention them at all, and seems to have all the needed functionality. i.e. the plugins seem to work out of the box, so why the modifications.

    Can you clarify what your modifications do and/or what problems they are attempting to solve?

  14. Michael July 10, 2020 | 1:59 pm

    Kinda figured this out, but the function or template is messing up the Subscription option label, as it’s combining the two into “Subscribe and save 3% every One-time purchase Subscribe and save 3%” (see screenshot –
    I entered “Subscribe and save 3% every” in the Title field, but it’s getting mangled.
    How does one fix this? Thanks.

  15. Mayank September 4, 2020 | 3:09 pm

    How can we switch from premium plan to free plan after the 14 days trial expire ?

    • Simon Gondeck September 13, 2020 | 1:40 am

      Create a variable product that has 2 variants: Free Plan ($0/month) and Premium Plan ($25/month). Add a 14-day free trial to the Premium Plan. When a customer goes through the Checkout process they will sign up to the Premium Plan. Do you want to allow customers to sign-up without a payment method? If so, go to your WooCommerce settings and check “Allow $0 initial checkout without a payment method”. After customer’s 14-day free trial is over, they would be required to put their payment method down to get access to your Premium Plan.

      Are you currently using a simple product or variant product? Are you using WooCommerce Memberships or anything else that would only show content if user is on the Free Plan?

  16. Tatsat September 16, 2020 | 9:55 am

    I saw your screenshot where you have 10% discount. I have that same thing for my store but I have found out that lately customers are subscribing the the product and then cancelling the subscription before the next one is ordered. This way they are trying to save 10%. Is there any way to tackle that?

    • Simon Gondeck September 16, 2020 | 4:57 pm

      Hey Tatsat, I hear you! Customers are going to always try to take advantage of the system. One thing you could do is install the Enhancer for WooCommerce Subscriptions plugin. This is an add-on plugin for WC Subscriptions and has a “Subscription Cancel Delay feature” that allows you to customize the date customers may start cancelling their subscriptions once they’ve subscribed. This prevents users from cancelling their subscription just before their first renewal to take advantage of subscription pricing.

Leave a reply

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted. Your email address will not be published. Required fields are marked*



All Products for WooCommerce Subscriptions
How to add a product to an existing WooCommerce Subscription?

The plugin has released an update that allows for you to choose an alternative layout called “Grouped” that separates 1-time purchase from the subscription options in a dropdown. You can choose this layout by editing your Product page and clicking “Subscriptions” then the Layout type. Get the All Products for WooCommerce Subscriptions extension at

How does this differ from a variable subscription product?

If you setup a variable product subscription all you can do is set variants for a specific billing period (i.e. every month, every 2 months, every 3 months). There is no option to offer a one-time purchase without making a new product and making the customer go to 2 different product pages. The All Products for WooCommerce Subscriptions plugins allows you to make any simple/variable product available as one-time purchase and subscription, without changing the way your manage inventory. In addition, easily offer discounts as an extra incentive for subscribing, rather than using coupon plugins that may not always work well.

Does it work with variable product?

Yes. The add-on allows you to make any simple or variable product on subscription.

How can I add a one-time coupon code in additional to the subscribe and save discount?

To do this you would need to add an additional coupon with the Discount type set as a “Recurring Product % Coupon”. The coupon should only be valid for the 1st payment. For example, the product costs $59.99. In addition, you also have a subscribe and save option at 20% off for $47.99. You also want to offer a one-time 20% additional coupon off the subscribe and save option so the first purchase is $35.99 instead of $47.99. But the product recurs monthly at the normal subscription price of $47.99.

Sample Product

  • One-time purchase price: $59.99
  • Subscribe every month for 20% off ($59.99 * 0.8): $47.99
  • Subscription price for 1st purchase only ($59.99 * 0.6): $35.99

Subscription price and billing schedule (every month)

  • 1st month (i.e. 1st purchase):  $35.99
  • 2nd month: $47.99
  • 3rd month: $47.99
  • Xth month: $47.99

How to set an additional discount for the 1st purchase only?

You would add the coupon amount to be a 25% recurring product discount since the coupon is applying to the Subscription price (i.e. $47.99 * 0.75 = $35.99).

If you did a 20% recurring product discount (i.e. $47.99 * 0.80) the price would be $38.39.


If you want to have the coupon “auto-apply” you could use the Smart Coupons plugin.


Live example

You can test this out by going through the Checkout process with the Sam’s Coffee product:

1X Purchase Only
Can I buy 1 subscription product and a non-subscription product on the same order?

Yes, you need to purchase the All Products for WooCommerce Subscriptions extension on your WooCommerce site.

Mixed Cart
What is a mixed checkout in WooCommerce?

A Mixed Checkout in WooCommerce is when a single transaction includes both subscription products and one-time products.

To allow multiple subscriptions and products to be purchased in a single transaction, check the option for the Mixed Checkout setting in your WooCommerce settings under the Subscriptions tab.


If you do not want multiple subscriptions and products to be purchased in a single transaction, uncheck the Mixed Checkout setting. If you try to add a product to your Cart, you will see the following message “A subscription has been removed from your cart. Products and subscriptions can not be purchased at the same time.”


Guest Checkout
How enable Guest Checkout for WooCommerce Subscription Orders?

How enable Guest Checkout for WooCommerce Subscription Orders?

  1. WooCommerce > Settings > Accounts & Privacy > Guest Checkout:
    • Disable: Allow customers to place orders without an account
    • Enable: Allow customers to log into an existing account during checkout
  2. WooCommerce > Settings > Accounts & Privacy > Account Creation:
    • Enable: Allow customers to create an account during checkout
    • Enable: When creating an account, automatically generate an account username for the customer based on their name, surname or email
  3. Click ‘Update’