Advanced Order Export for WooCommerce

WooCommerce Appointments

Running a booking site? Need to export appointments between specific dates?

The built-in date filter uses order date. Not helpful when customers book weeks in advance.

This code filters by appointment start date instead.

What this code does

Replaces the standard date filter. Now your from/to dates apply to appointment start times. Not order creation times.

Export all appointments starting next week. Or last month’s completed appointments.

The complete code

How to use it

  1. Copy the code into your theme’s functions.php
  2. Go to Advanced Order Export for WooCommerce
  3. Open your export profile
  4. Look for the standard date range picker (From Date / To Date)
  5. Select your appointment date range as usual
  6. Run the export

The code intercepts your dates. Applies them to appointment start times instead.

Real example

You run a spa. Customers book massages 2 weeks out.

Today is June 1. You want all appointments for June 15-20.

Set From Date: June 15. To Date: June 20.

Standard export shows orders placed on June 1 (wrong). This code shows appointments starting June 15-20 (correct).

When you need this

You sell services by appointment. Need next week’s schedule.

Your staff needs daily appointment lists. Not order date lists.

You track no-shows. Need to export appointments from last week only.

You reconcile payments with completed appointments. Date range must match service dates.

How it works under the hood

WooCommerce Appointments stores appointment start times as post meta (_appointment_start). Values are Unix timestamps.

The code converts your human-readable dates (2026-06-15) to timestamps. Then filters appointments within that range. Then finds which orders contain those appointments.

Common mistake

The code only works with the official WooCommerce Appointments plugin (from WooCommerce.com). Not other booking plugins.

Also, your from/to dates must match your WordPress timezone. The code uses strtotime() with site time.

Empty export?

No appointments in your date range? Export will be empty.

Test with a wide range first (last 30 days). Verify appointments appear. Then narrow down.

Pro tip

Want to filter by appointment end date instead? Change _appointment_start to _appointment_end in the code.

Need both start AND end? Modify the SQL to check both meta keys.

Real talk

Most store owners want appointment date filters. Not order date filters.

This code swaps them cleanly. No need to explain to your staff “ignore the order date, look at appointment time.”

Your team exports next week’s schedule. They see exactly what they need. No confusion.

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