Created
July 10, 2020 17:02
-
-
Save bookchiq/9de974b0fa56a7abff45d4be88b3c381 to your computer and use it in GitHub Desktop.
SQL to delete orphaned postmeta in WordPress
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 pm | |
FROM wp_postmeta pm | |
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id | |
WHERE wp.ID IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment