Advanced Order Export for WooCommerce

Woocommerce Subscriptions

Selling subscription products? Need to track payment dates and status?

Standard order exports show the initial purchase. Not the subscription’s ongoing details.

Here’s how to export subscription numbers, status, and payment dates.

What this code exports

Adds five subscription columns to your order export:

  • Sub. Number (the subscription ID)
  • Sub. Status (active, cancelled, expired, etc.)
  • Sub. Start Date (when subscription began)
  • Sub. Next Payment (upcoming renewal date)
  • Sub. Last Order Date (most recent order date)

Each column pulls data from the subscription itself. Not the parent order.

The complete code

Setup steps

  1. Copy the entire code block
  2. Paste into your theme’s functions.php
  3. Go to Advanced Order Export for WooCommerce
  4. Create or edit an export profile
  5. Open Setup Fields → Cart
  6. You’ll see subscription fields. Check the ones you need
  7. Save and test on a subscription order

What your export looks like

Order #ProductSub. NumberSub. StatusSub. Start DateSub. Next PaymentSub. Last Order Date
1001Monthly Plan#SUB-123active2026-01-152026-06-152026-05-15
1002Yearly Plan#SUB-456cancelled2026-02-012026-04-01

When you need this

You sell subscriptions. Need to track which customers are active.

Your support team needs next payment dates for billing inquiries.

You run reports on subscription status (active vs cancelled).

You reconcile payments. Need last order date for each subscription.

How it works

The code finds the subscription linked to your order. Uses WooCommerce Subscriptions functions:

  • wcs_get_subscriptions_for_order() finds subscriptions by order ID
  • wcs_get_subscription() gets subscription by ID

Then pulls key dates and status. Formats them for your export.

Two export scenarios

Exporting a regular order: The code finds the associated subscription. Shows its details.

Exporting a subscription (direct object): The code treats the subscription itself as the export. Shows its own details.

Common mistake

The code requires WooCommerce Subscriptions plugin. Function wcs_get_subscriptions_for_order() must exist.

Also, subscriptions must be active. A cancelled subscription still exports. But shows “cancelled” status.

Empty or incorrect dates?

No next payment? Subscription is cancelled or expired. The code shows “-” instead.

Wrong date format? Change wc_date_format() to your preferred format: 'Y-m-d' or 'm/d/Y'.

Pro tip

Need subscription end date? Add a field:

Then in get_subscription_details():

Need trial end date? Use trial_end_date instead.

Real talk

WooCommerce Subscriptions stores subscription data separately from orders. A single subscription can have many orders (renewals).

This code finds the right subscription. Pulls the current status and key dates.

Your customer support team gets complete subscription visibility. No more clicking through multiple order screens. One export shows everything they need.

Have questions? Please submit a support request. We're always happy to help!

Advanced Order Export
for WooCommerce
PRO

From $30
Buy
✓ 30-day money-back guarantee