duanaiguang1960 2018-09-02 17:39
浏览 44
已采纳

重复WooCommerce商店升级(删除订单)

A client is running an online shop with Wordpress and WooCommerce. Now as their shop grew bigger and the need for more development grew I wanna setup a staging shop for a better and safer workflow. I did a backup of the production shop but I'm wondering how can I remove all order data fast, safe and without notifying the customers to get a production-customer free staging shop with all the products still available.

I found define ('WC_REMOVE_ALL_DATA', true); but that will remove products aswell.

  • 写回答

1条回答 默认 最新

  • dsg435665475 2018-09-02 18:18
    关注

    There are couple of ways for deleting the WooCommerce orders. You can follow the convenient way. No email notification will be sent to the customer.

    Method 1: Use this plugin - WC Delete all orders.

    Method 2: Go to 'Orders' screen, select (check) all orders and choose Move to Trash from 'Bulk Options' dropdown. Click on 'Trash' and click Empty Trash button.

    Method 3: Add this to your theme's 'functions.php', run only once and remove.

    global $wpdb;
    $wpdb->query("UPDATE $wpdb->posts SET post_status = 'trash' WHERE post_type = 'shop_order'");
    

    Now all of your orders will be moved to trash and you can delete all by clicking Empty Trash button.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题