Automatically trash pending orders in WooCommerce
Published by John Jago
Summary
This short tutorial describes how to automatically move orders left in “Payment pending” status to the trash after a certain amount of time. No custom code or plugins required.
In WooCommerce, it’s possible to delete pending orders, which are unpaid and likely abandoned, after a given amount of time to help keep your order list clean. The steps below show you how to enable this.
- From the WordPress dashboard, navigate to WooCommerce → Settings in the left sidebar.
- Open the “Accounts & Privacy” tab.
- Scroll to the bottom and find where it says “Retain pending orders”.
- You can set the amount of time after which a pending order will be deleted. For example, I set it to 7 days.
Keep in mind
Sometimes, there may have been an issue, and the customer will retry later. Depending on how much time has passed, WooCommerce may consider it the same order, and it will update the existing order that has been created. This gives you a complete history of the customer’s activity.
You may also want to send follow ups to see if the customer experienced some issue checking out, before deleting the order.
With those two considerations, you may want to set the order trash time to be not too short.
Trashed orders can be recovered
If you’re wondering if the automatically deleted orders can be recovered, the answer is yes! They can be found in the Trash tab of the WooCommerce orders page.
👋 Hey there! We’re the creators of Dashify, a free plugin that transforms the WordPress admin into an ecommerce-focused dashboard, helping you manage your store faster and more effectively.