Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sidouglas/98be4369f64b46e3c1f651087aaf26e9 to your computer and use it in GitHub Desktop.
Save sidouglas/98be4369f64b46e3c1f651087aaf26e9 to your computer and use it in GitHub Desktop.
Delete all orphans user meta in WordPress
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment