How to Change the Next Payment Date in WooCommerce Subscriptions

WooCommerce Subscriptions is commonly used to handle recurring billing, and there are scenarios where the next renewal date of an active subscription needs to be adjusted. This often comes up in cases such as billing corrections, customer support requests, proration logic, or aligning renewals with a specific schedule. In this article, I will walk through how to update the next payment date in WooCommerce Subscriptions and highlight the important details you should be aware of.

How to change the next payment date?

WooCommerce Subscriptions provides two different hooks depending on when the subscription is being handled. The first one runs when a subscription is created during checkout and is used for new subscriptions — woocommerce_checkout_subscription_created.

The second hook is triggered for scheduled renewal payments (excluding the initial payment) and is used to handle future billing cycles — woocommerce_scheduled_subscription_payment. Understanding the difference between these two hooks is essential when you need to control or modify the next payment date correctly.

How to change the next payment date for new subscriptions?

For example, you want all subscribers who signed up in June or July to have the same next payment date — August 31 — regardless of their signup date. This is a common requirement for seasonal billing or aligned renewal cycles. In this case, we can use the woocommerce_checkout_subscription_created hook and create a custom function that sets the next renewal date when the subscription is first created.

				
					add_action('woocommerce_checkout_subscription_created', function($subscription, $order, $recurring_cart) {
    // Ensure we have valid subscription and order objects
    if ($subscription instanceof WC_Subscription) {
        if ($order instanceof WC_Order) {
            // Mark the initial order as paid
            $order->payment_complete();
        }

        // Get current month
        $number_of_month = date('n'); // numeric month (1-12)
        $vacation = false;

        // Check if we are in vacation period (June, July)
        if ($number_of_month == 6 || $number_of_month == 7) {
            $vacation = true;
        }

        if ($vacation) {
            // If vacation, set next payment to August 31st
            $year = date('Y');
            $last_day_of_next_month = strtotime("$year-08-31 03:00:00");
        } else {
            // Regular subscription: set next payment to end of next month
            $next_month = strtotime('first day of next month');
            $last_day_of_next_month = strtotime('last day of this month 13:00:00', $next_month);
        }

        // Update subscription next payment date
        $subscription->update_dates([
            'next_payment' => date('Y-m-d H:i:s', $last_day_of_next_month)
        ]);
        $subscription->save();

        // Schedule the WooCommerce subscription payment using Action Scheduler
        if (function_exists('as_schedule_single_action')) {
            as_schedule_single_action(
                strtotime($subscription->get_date('next_payment')),
                'woocommerce_scheduled_subscription_payment',
                ['subscription_id' => $subscription->get_id()]
            );
        }
    }
}, 10, 3);
				
			

We use the woocommerce_checkout_subscription_created hook, which receives the $subscription, $order, and $recurring_cart parameters. This allows us to access the subscription object and apply custom logic at the moment the subscription is created.

$subscription – A WC_Subscription instance representing the subscription just created on checkout.
$order – A WC_Order instance representing the order for which subscriptions have been created.
$recurring_cart – A WC_Cart instance representing the cart which stores the data used for creating this subscription.

The first step is to get the current date, specifically the current month. We are doing it to determine whether the subscription was created during the required period and apply the correct next payment date logic.

				
					// Get current month
$number_of_month = date('n'); // numeric month (1-12) 
				
			

Next, we check whether the current date falls within our defined “holiday” period. This allows us to apply the custom next payment date only to subscriptions created during that specific timeframe.

				
					// Check if we are in vacation period (June, July)
if ($number_of_month == 6 || $number_of_month == 7) {
    $vacation = true;
}
				
			

If the current date falls within the defined “holiday” period, we create a new “next payment” date using “strtotime” for August 31 of the current year. This will be used to set the subscription’s next payment date.

				
					// If vacation, set next payment to August 31st
$year = date('Y');
$last_day_of_next_month = strtotime("$year-08-31 03:00:00");
				
			

If the current date does not fall within the holiday period, we can either set the next payment date to the last day of the current month or leave it unchanged and let WooCommerce Subscriptions handle the renewal schedule automatically.

				
					// Regular subscription: set next payment to end of next month
$next_month = strtotime('first day of next month');
$last_day_of_next_month = strtotime('last day of this month 13:00:00', $next_month);
				
			

In the next step, we need to update the subscription itself by taking the calculated next payment date and setting it as the subscription’s next renewal date.

				
					// Update subscription next payment date
$subscription->update_dates([
    'next_payment' => date('Y-m-d H:i:s', $last_day_of_next_month)
]);
$subscription->save();
				
			

After updating the next payment date on the subscription, we also need to reschedule the renewal action itself. WooCommerce Subscriptions relies on Action Scheduler to trigger renewal payments. In this step, we schedule a new single action for the woocommerce_scheduled_subscription_payment hook using the updated next payment date. This ensures that the renewal process runs at the correct time based on the modified subscription schedule.

				
					// Schedule the WooCommerce subscription payment using Action Scheduler
if (function_exists('as_schedule_single_action')) {
    as_schedule_single_action(
        strtotime($subscription->get_date('next_payment')),
        'woocommerce_scheduled_subscription_payment',
        ['subscription_id' => $subscription->get_id()]
    );
}
				
			

How to change the next payment date for an active subscription?

In this case, we will use the same approach: if the current date falls within the defined holiday period, we update the next payment date for the active subscription accordingly.

				
					add_action('woocommerce_scheduled_subscription_payment', function($subscription_id) {
    $subscription = wcs_get_subscription($subscription_id);

    if ($subscription) {
        $wgtrial = false;
        $today = strtotime(date('Y-m-d')); // Today timestamp
        $start = strtotime(date('Y') . '-06-30'); // Trial start date
        $end = strtotime(date('Y') . '-08-14');   // Trial end date

        // Determine if we are in trial/vacation period
        $wgtrial = ($today >= $start && $today <= $end);

        if ($wgtrial) {
            // During trial period, set payment to August 15th with 100% discount (free)
            $year = date('Y');
            $last_day_of_next_month = strtotime("$year-08-15 13:00:00");
        }

        // Update subscription next payment date only if subscription not ending earlier
        $end_date = $subscription->get_date('end');
        if (($end_date && strtotime($end_date) > $last_day_of_next_month) || !$end_date) {
            $subscription->update_dates([
                'next_payment' => date('Y-m-d H:i:s', $last_day_of_next_month)
            ]);
            $subscription->save();

            // Schedule the next payment with Action Scheduler
            if (function_exists('as_schedule_single_action')) {
                as_schedule_single_action(
                    strtotime($subscription->get_date('next_payment')),
                    'woocommerce_scheduled_subscription_payment',
                    ['subscription_id' => $subscription->get_id()]
                );
            }
        }
    }
}, 10, 1);
				
			

We use the woocommerce_scheduled_subscription_payment hook, which receives only the $subscription_id parameter. This parameter represents the ID of the subscription for which a recurring renewal payment is being processed, allowing us to apply custom logic for active subscription payments.

We follow the same logic by getting today’s date and checking whether it falls within the holiday period before applying any changes to the subscription’s next payment date.

				
					//get current date
$today = strtotime(date('Y-m-d')); // Today timestamp
$start = strtotime(date('Y') . '-06-30'); // Trial start date
$end = strtotime(date('Y') . '-08-14');   // Trial end date
// Determine if we are in trial/vacation period
$wgtrial = ($today >= $start && $today <= $end);
				
			

If the current date falls within the holiday period, we set the next payment date to August 15 of the current year.

				
					//if we are in trial period
    if ($wgtrial) {
        // During trial period, set payment to August 15th with 100% discount (free)
        $year = date('Y');
        $last_day_of_next_month = strtotime("$year-08-15 13:00:00");
    }
				
			

The key difference between processing new subscriptions and active subscriptions is that we must check whether an active subscription has an expiration date. We cannot set the next payment date later than the subscription expiration date, so this check is mandatory. In the code below, we first get the subscription end date and compare it to the calculated next payment date. If the subscription is still active or has no end date, we update the next payment date and save the subscription. We then reschedule the renewal action using Action Scheduler to ensure that the payment occurs at the correct time.

				
					// Update subscription next payment date only if subscription not ending earlier
    $end_date = $subscription->get_date('end');
    if (($end_date && strtotime($end_date) > $last_day_of_next_month) || !$end_date) {
        $subscription->update_dates([
            'next_payment' => date('Y-m-d H:i:s', $last_day_of_next_month)
        ]);
        $subscription->save();

        // Schedule the next payment with Action Scheduler
        if (function_exists('as_schedule_single_action')) {
            as_schedule_single_action(
                strtotime($subscription->get_date('next_payment')),
                'woocommerce_scheduled_subscription_payment',
                ['subscription_id' => $subscription->get_id()]
            );
        }
    }
				
			

By combining the correct WooCommerce Subscriptions hooks with custom date logic, you can fully control when subscription renewals occur. This approach is especially useful for seasonal billing, aligned payment cycles, or custom business rules that don’t fit the default subscription behavior. With careful handling of subscription dates and scheduled actions, you can ensure renewals are processed exactly when your business requires.

If you need help implementing custom subscription logic, feel free to contact us — we’ll gladly assist.

Comments

Justin
January 20, 2026 at 10:12
Thank you, bro! You saved my day :)

Share Your Thoughts

Join the conversation!

Scroll to Top

Share Your Thoughts

Thank you for your comment!

Your email address will not be published. Required fields are marked *

Pro

Thank you for reaching out! We’ll be in touch within 24 hours to discuss your project

Standard

Thank you for reaching out! We’ll be in touch within 24 hours to discuss your project

Basic

Thank you for reaching out! We’ll be in touch within 24 hours to discuss your project

Contact us

Thank you for reaching out! We’ll be in touch within 24 hours to discuss your project

Fill out the form below, and we’ll get back to you within 24 hours