Woocommerce – Prune Completed / Older Orders

Hi,

Fully tuned, tweaked wordpress website running woocommerce. However i can’t avoid that over time, things start to turn slow. Really slow. I’ve figured out that database entries ranging from 2015 till now are the cause of it, and in particular over 90k of “completed” orders.

Now most will say HAH then delete it – it’s not that easy. In the country this webshop is resident a administration of up to 7 years needs to be stored or saved. So my idea was, is there a way to safely export all the given orders, store it offline, and prune the existing completed ones?

If yes, what’s the best step? The performance just tanks with Woocommerce. It’s a fully beefed up server with litespeed, object cache, cloudflare pro, but it’s just stupid to see the amount of time needed for woocommerce to do it’s rounds before requesting a list of products.

There’s a 2.5 avg second delay needed and the cause is obviously the database and it’s huge entries.

2 Comments
  1. You could export the orders into a CSV file for you to store locally, or wherever you store business-related files (plugins like [this one](https://wordpress.org/plugins/order-import-export-for-woocommerce/) would probably work well, although I’ve not personally used it).

    You could then technically delete those completed orders, but remember that deleting these orders will also remove them from your customer’s accounts.

    I’m not sure whether HPOS (high performance order storage) would improve things much for a site with over 90k orders, but have you enabled it to see? This would at least move the data out of the regular posts/post meta tables, which may speed things up slightly.

  2. I find the best way is to take a full backup, which can be spun up later if the information is needed. Store the data, and you’ll be fine.

    The real issue is for recurring clients order history which removes the orders if you delete them from the live site.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer