根据 Woocommerce 中的日期批量更改订单状态

Bulk change the order status based on a date in Woocommerce

以下 sql 查询将更改订单状态:

update wp_posts set post_status = 'wc-completed' where post_type = 'shop_order' and post_status ='wc-processing' ;

如何只更改特定日期之前的订单的状态?

要在日期 之前批量更改订单状态(例如在 05 OCT 2018 之前) 使用此 SQL 查询 (制作之前总是有数据库备份)

UPDATE `wp_posts` 
SET `post_status` = 'wc-completed' 
WHERE `post_type` = 'shop_order' 
AND `post_status` ='wc-processing' 
AND `post_date` < '2018-10-05 00:00:00';

已测试并有效