Checking woocommerce product database entry integrity
-
Question:
Is there a plug-in or a set of instructions how to check and restore the integrity of the Woocommerce product database in WordPress.
Detailed explanation follows….
One of my woocommerce installations seems to have accumulated a lot of duplicated data in the variations area. For example, there is a variable product in a database that has 10 variations, and each variation (based on size) has multiple entries of the same size (47).
So… Product that has size variations, for example S, M, L, XL – has 47 entries for S “_price” meta key in the meta table. This causes issues sometimes as when the product detail screen is attempting to display the dropdown of all variations, or at the execution of something like following will fail:
$prod->get_available_variations();
On closer investigation – here is a list of Variations – all with the same variation slug – price is given as a good example, but all other fields behave in the same way:
PRODUCT_ID VARIATION_ID SLUG VARIATION_NAME META_KEY META_VALUE
42147 42148 75b 75B _price 44.38
42147 42149 75b 75B _price 44.38
42147 42150 75b 75B _price 44.38
42147 42151 75b 75B _price 44.38
42147 42152 75b 75B _price 44.38
42147 42153 75b 75B _price 44.38
42147 42154 75b 75B _price 44.38
42147 42155 75b 75B _price 44.38
42147 42156 75b 75B _price 44.38
42147 42157 75b 75B _price 44.38
42147 42158 75b 75B _price 44.38
42147 42159 75b 75B _price 44.38
42147 42160 75b 75B _price
42147 42161 75b 75B _price 44.38
42147 42162 75b 75B _price 44.38
42147 42163 75b 75B _price 44.38Any help would be appreciated, I am happy to write a SQL or PHP code to deal with it, but I would prefer already existing solution.
- The topic ‘Checking woocommerce product database entry integrity’ is closed to new replies.