Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogists/c882884b0ef42b0f9adde7d27b6e68af to your computer and use it in GitHub Desktop.
Save woogists/c882884b0ef42b0f9adde7d27b6e68af to your computer and use it in GitHub Desktop.
[Bulk Stock Management] Fix the display of variations which have been deleted SQL
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