want to bulk delete 16,000 items from Drafts — manual is extremely slow
-
A client has a WooCommerce 3.2.3 site were the product breakdown is:
460 Published
16,388 Drafts
2,228 in Trash(We believe the huge number of “Drafts” is because they tried to do a bulk-upload of products from another source and it kept failing.)
We are trying to get rid of the huge number of products in Drafts and Trash, since the server seems slow and almost all of our 2 GB of RAM is getting consumed, and I’ve seen several sources saying that WooCommerce can get slow if you have tens of thousands of products, so we want to clear out Drafts and Trash and see if that fixes it.
However, doing this manually is extremely slow and aggravating since if we try to delete more than 100 at a time from Drafts, the operation times out, so we have to delete one page-ful of 100 products, wait a few minutes, delete the next page-ful, etc. And in the Trash folder, the “Empty Trash” button doesn’t work — it idles for a few minutes and then times out, whereupon we come back to the Trash folder and see that it’s deleted a few hundred items but it’s far from empty — so, after moving thousands of items from Drafts to Trash, we’d have to go to Trash and do it all again.
So is there an easier way to bulk-move WooCommerce products from Drafts to Trash, or to delete the Trash without getting repeated timeouts and restarts?
I know how to go to phpMyAdmin and run the query:
DELETE FROM wp_posts WHERE post_type='product' AND post_status='draft';
however presumably this would leave all the metadata about those posts in the wp_postmeta table, which has about 600,000 rows due to data associated with the product posts.
I know there are some third-party plugins that let you bulk-delete draft and trash posts, but not sure if people have had success with those for cleaning up WooCommerce products.
- The topic ‘want to bulk delete 16,000 items from Drafts — manual is extremely slow’ is closed to new replies.