Some of us use “Hold Stock” features to cancel pending payment order and Woocommerce has this feature natively in Woocommerce.
Based on this setting, any unpaid order within 35 minutes will be cancelled. Well, at least that is the idea.
Today I just discovered this function doesn’t work and we have bunch of “Pending Payment” order.
Quick way to fix this is to update the Hold Stock value to some numbers, and save it again. This should be a quick fix.
The probable explaination of this issue is actually due to cron job is either missing or doesn’t work on your server or hosting.
On my case, that is due to cron job is missing.
To investigate further on the cron job, you can install WP Control plugin.
Once installed and activate, you can further check all of the cron job available.
From WordPress, go to Tools > Cron Events
In this particular issue, you should see “woocommerce_cancel_unpaid_orders” cron. If you don’t, that probably the reason why the status or hold stuck function doesn’t work.
However, you can manually add the cron job.
Use “woocommerce_cancel_unpaid_orders” on the hook name field and then click “Add Event”
That’s it. It should fix the issue.
Let me know if you are still having problem with it.