WooCommerce WordPress

Cancel WooCommerce not-paid Orders automatically

One way to keep your online store clean and organized is using the order status. Complete, Cancelled, Awaiting Payment are type of status which helps you to pay attention at the most important orders.

But when you have a lot of “Awaiting payment” orders and you don’t know until when you need to consider that order? Well, I’m writing today because of that. A client of mine gave me this problem: I want to cancel my pending orders (awaiting payment) after 4 days.

Before the solution we discuss about:

  • Should we need to consider all the payment methods?
  • The client should be receive any type of email confirm?
  • Which order status we need to consider?

Well, those answers aren’t too important for this post. 🙂 But after that, I started to code. Follow me, step by step: