Automatic Order Expiration

Automatic Order Expiration for WooCommerce automatically expires pending orders after a configurable number of days, sends customer reminder emails before expiration, and notifies administrators with a batch summary when orders close.


Installation

↑ Back to top

To start using a product from WooCommerce.com, you can use the โ€œAdd to storeโ€ functionality on the order confirmation page or the My subscriptions section in your account.

  1. Navigate to My subscriptions.
  2. Find the Add to store button next to the product youโ€™re planning to install.
  3. Follow the instructions on the screen, and the product will be automatically added to your store.

Alternative options and more information at:
Managing WooCommerce.com subscriptions.

Adding a WooCommerce.com subscription to your store

Setup and Configuration

↑ Back to top

Expiration Settings

↑ Back to top
  1. Go to WooCommerce โ†’ Settings โ†’ Order Expiration.
  2. Check “Enable expired order status” to activate automatic expiration โ€” the rest of the settings on this screen only appear once this is checked.
  3. Set “Days until expiration” โ€” the number of days a pending order remains active before being expired. Default is 10 days. Minimum is 1 day.
  4. Optionally customize the “Expiration message” โ€” this text is added as an order note when an order expires. Use %d as a placeholder for the number of days.
  5. Click Save changes.
The Order Expiration settings screen in WooCommerce, showing the 'Enable expired order status' checkbox and the Days until expiration field revealed underneath it
The Order Expiration settings screen โ€” the rest of the fields appear once “Enable expired order status” is checked.

Email Notifications

↑ Back to top

Email notifications are managed alongside every other WooCommerce transactional email, not in the plugin’s own settings tab.

  1. Go to WooCommerce โ†’ Settings โ†’ Emails.
  2. Find “Order Expiration Reminder” in the list and click Manage to enable it and customize the subject, heading, and additional content for the email sent to customers 24 hours before their order expires.
  3. Find “Order Expiration Summary” and click Manage to enable it, set the recipient (defaults to your site’s admin email), and customize the subject and heading for the batch email sent to you whenever orders expire.
  4. Both emails support WooCommerce’s built-in Preview button, so you can check exactly what customers and admins will receive before saving.
  5. Click Save changes on each email’s screen.
The Order Expiration Reminder email settings screen under WooCommerce Settings Emails, showing the enable checkbox, subject, and heading fields
The “Order Expiration Reminder” email settings screen, managed like any other WooCommerce email.
The Order Expiration Summary email settings screen under WooCommerce Settings Emails, showing the enable checkbox, recipient, subject, and heading fields
The “Order Expiration Summary” email settings screen, including the recipient field.

The extension reuses WooCommerce’s existing scheduled sales task instead of adding a new cron job, running approximately twice daily to check for orders to expire and reminders to send. Developers who want to hook into these events โ€” see the Developer Notes section near the end of this page.


Settings Reference

↑ Back to top

General Settings

↑ Back to top

Located at WooCommerce โ†’ Settings โ†’ Order Expiration. Everything below “Enable expired order status” is hidden until that checkbox is enabled, since it has no effect while expiration is off.

SettingDescription
Enable expired order statusMaster on/off switch. When disabled, no expiration checks run and no emails are sent.
Days until expirationNumber of days a pending order remains active before expiring. Default: 10. Minimum: 1.
Expiration messageText added as an order note when an order expires. Use %d as a placeholder for the number of days.
Enable debug loggingWhen enabled, logs expiration activity to WooCommerce โ†’ Status โ†’ Logs (source: automatic-order-expiration). Useful for troubleshooting.
Show in admin barAdds a quick link to the Order Expiration settings in the WordPress admin bar.

Email Settings

↑ Back to top

Located at WooCommerce โ†’ Settings โ†’ Emails, alongside every other WooCommerce transactional email โ€” including support for the native Preview button. Click Manage next to either email to edit it.

EmailDescription
Order Expiration ReminderSent to the customer 24 hours before their pending order expires. One reminder per order โ€” duplicate prevention is automatic. Subject and heading support the placeholders {order_number}, {order_date}, {customer_name}. The email body shows the standard WooCommerce order details table.
Order Expiration SummarySent to the recipient configured on the email’s settings screen (defaults to the site admin email) whenever a scheduled run expires one or more orders. Subject and heading support the {count} placeholder. The email body lists every expired order with its date, total, customer email, and a direct edit link.

Troubleshooting

↑ Back to top

Orders Are Not Expiring

↑ Back to top

Solution:

  • Confirm “Enable expired order status” is checked in settings.
  • Go to WooCommerce โ†’ Status โ†’ Scheduled Actions and search for woocommerce_scheduled_sales to confirm it’s scheduled to run.
  • Enable debug logging and check WooCommerce โ†’ Status โ†’ Logs for entries from automatic-order-expiration.

Customer Reminder Emails Are Not Sending

↑ Back to top

Solution:

  • Confirm the “Order Expiration Reminder” email is enabled under WooCommerce โ†’ Settings โ†’ Emails.
  • Check that the order’s billing email is set โ€” orders without a billing email cannot receive reminders.
  • Open the order and check its order notes โ€” if you see “Expiration reminder email sent to customer”, a reminder was already sent for this order and won’t be sent again.
  • Check your WordPress email delivery. Use a plugin like WP Mail SMTP to verify emails are being sent from your server.

“Expired” Status Doesn’t Appear in the Orders List

↑ Back to top

Solution:

  • Try deactivating and reactivating the plugin.
  • Check for plugin conflicts by temporarily disabling other plugins that modify WooCommerce order statuses.

Settings Are Not Saving

↑ Back to top

Solution:

  • Ensure you have the manage_woocommerce capability (typically Shop Manager or Administrator role).
  • Check for JavaScript errors in your browser console that might prevent the settings form from submitting.
  • Verify no security plugin is blocking the WooCommerce settings POST request.

Frequently Asked Questions

↑ Back to top

How often does the extension run?

↑ Back to top

The extension runs on WooCommerce’s scheduled sales task, which fires approximately twice per day. Check WooCommerce โ†’ Status โ†’ Scheduled Actions for the exact next scheduled time.

Will expired orders affect my inventory?

↑ Back to top

When an order moves to “Expired” status, WooCommerce releases the stock reservation (the same behavior as when an order is cancelled). Your available inventory updates automatically.

Can I restore an expired order?

↑ Back to top

Yes. Expired orders remain in your database. You can manually change an expired order’s status to any other status from the order edit screen in WooCommerce โ†’ Orders.

Does the extension work with HPOS?

↑ Back to top

Yes โ€” the extension is fully compatible with WooCommerce High-Performance Order Storage (custom order tables). It only uses WooCommerce’s official order APIs to read and update orders, never direct database access.


Developer Notes

↑ Back to top

The information below is intended for developers customizing or integrating with this extension. Custom code built on these hooks and templates is not covered under our standard support policy.

Triggering a Run Manually (for Testing)

↑ Back to top

The expiration and reminder checks can be triggered on demand via WP-CLI, useful for testing or for a one-time cleanup of a large backlog of pending orders:

wp eval 'do_action("woocommerce_scheduled_sales");' --allow-root

How HPOS Compatibility Is Implemented

↑ Back to top

The extension uses wc_get_orders() for all order queries, and $order->get_meta() / $order->update_meta_data() for order meta โ€” no direct database table access, so it works identically with and without HPOS enabled.

Order Meta

↑ Back to top

The extension stores a single meta key on each order to prevent duplicate reminder emails:

  • _nuvirro_aoe_reminder_sent โ€” set to the timestamp the reminder was sent, once per order.

Action Hooks

↑ Back to top

The extension fires the following actions for developers who want to hook into expiration events:

  • nuvirro_aoe_order_expired โ€” fires after each individual order is expired (passes $order_id and $order)
  • nuvirro_aoe_orders_expired โ€” fires after all orders in a scheduled run are processed (passes array of $expired_orders)
  • nuvirro_aoe_reminder_sent โ€” fires after a customer reminder email is sent (passes $order_id and $order)
  • nuvirro_aoe_admin_summary_sent โ€” fires after the admin summary email is sent (passes array of $expired_order_ids)

Filter Hook

↑ Back to top

nuvirro_aoe_settings โ€” filters the Order Expiration settings fields array before it’s rendered, letting developers add or modify fields on the settings screen.

Overriding Email Templates

↑ Back to top

Both notification emails use standard WooCommerce email templates, which can be overridden from your theme the same way you’d override any WooCommerce email template โ€” copy the file into your theme and edit it there:

  • yourtheme/woocommerce/emails/customer-reminder.php and yourtheme/woocommerce/emails/plain/customer-reminder.php
  • yourtheme/woocommerce/emails/admin-summary.php and yourtheme/woocommerce/emails/plain/admin-summary.php

Related Products

Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.

Offer add-ons like gift wrapping, special messages or other special options for your products.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.