Skip to content

Commit

Permalink
Blog: “Automatically trash pending orders in WooCommerce”
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjago committed May 20, 2024
1 parent a7fdbce commit 1e77871
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
+++
title = 'Automatically trash pending orders in WooCommerce'
slug = 'auto-trash-pending-orders-woocommerce'
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.'
date = 2024-05-20T07:37:05-05:00
draft = false
+++

{{< rawhtml >}}
<div class="rounded-lg px-8 py-8 bg-[#9D6095E3] text-gray-50 text-lg">
<h2 class="text-gray-50" style="margin-top: 0; margin-bottom: 0.6rem;">Summary</h2>
<p style="margin-bottom: 0;">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.</p>
</div>
{{< /rawhtml >}}

***

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.

1. From the WordPress dashboard, navigate to **WooCommerce → Settings** in the left sidebar.
2. Open the “**Accounts & Privacy**” tab.
![Screenshot of the WooCommerce settings page, with arrows pointing to the sidebar where to get to the settings, and then pointing to the Accounts & Privacy tab.](/blog/auto-trash-pending-orders-woocommerce/auto-trash-pending-orders-1.png)
3. Scroll to the bottom and find where it says “**Retain pending orders**”.
4. You can set the amount of time after which a pending order will be deleted. For example, I set it to 7 days.
![Screenshot of the bottom of the Accounts & Privacy WooCommerce settings page, where there is an option to choose the amount of time before a pending order is deleted.](/blog/auto-trash-pending-orders-woocommerce/auto-trash-pending-orders-2.png)

## 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.

0 comments on commit 1e77871

Please sign in to comment.