Created
November 27, 2015 09:25
-
-
Save corsonr/dedfa5ca719488291170 to your computer and use it in GitHub Desktop.
Delete WooCommerce Orphaned Variations
This file contains hidden or 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 o FROM `wp_posts` o | |
LEFT OUTER JOIN `wp_posts` r | |
ON o.post_parent = r.ID | |
WHERE r.id IS null AND o.post_type = 'product_variation' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you explain why it has..
DELETE o
while this one..
https://gist.github.com/corsonr/cb4541c0c3d8303c6f5e#file-gistfile1-txt
is..
cheers