``` # show the orphan postmeta SELECT * FROM tableprefix_postmeta pm LEFT JOIN tableprefix_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; # remove the orphan postmeta DELETE pm FROM tableprefix_postmeta pm LEFT JOIN tableprefix_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; ```