Last active
December 7, 2022 17:49
-
-
Save mrkaluzny/d54e3356fc268dc659528973c72a70ee to your computer and use it in GitHub Desktop.
Remove duplicate stock from WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE pm1 | |
FROM wp_postmeta pm1, | |
wp_postmeta pm2 | |
WHERE | |
pm1.meta_key = '_stock' | |
AND pm2.meta_key = '_stock' | |
AND pm1.post_id = pm2.post_id | |
AND pm1.meta_id < pm2.meta_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment