Junk in database after CSV import, even after removing all products
-
I’m preparing to launch my shop using WooCommerce. This is really great product, congratulations for team. I’ve found however some issue with lot of database junk created during testing and importing products from csv files.
Even after deleting all products, I found lot of junk entries in wp_posts and wp_postmeta tables. Their title is “Import placeholder for *” with SKU, post status is “publish”. There’s 2082 entries in ‘wp_posts’ table and around 72870 records in ‘wp_postmeta’. This is creating already performance issues with WooCommerce.
I don’t see any option to remove such orphan entries from database.
They’re created by https://github.com/woocommerce/woocommerce/blob/master/includes/import/class-wc-product-csv-importer.php, line 173
(comment from code: “If we’re not updating existing posts, we may need a placeholder product to map to.”)My question is:
– Is there a script or hidden function in CP to remove all products related data and start from 0, without clearing all settings made in WooCommerce?
– Do someone has experience in removing this stuff? Is script removing such entries from ‘wp_posts’ table and entries from ‘wp_postmeta’ with matching post_id will be enough, or something else may be needed?
– Do this function really needed to work that way in WooCommerce? This is creating huge everhead in database. If so, maybe some function would be nice to clear stuff after deleting or importing products?I will gently suggest that a) restoring database from backup and b) get better server answers are not favorable options for now ??
Thank you,
Peter
- The topic ‘Junk in database after CSV import, even after removing all products’ is closed to new replies.