I'm looking to cleanup wp_postmeta. I've found dozens of duplicate entries.
I've spend about 8 hours looking through topics and trying code and plugins to no avail.
The most useful article on the subject I found is this.
However the article is from 5 years ago and I'm not sure that the suggested code leaves at least 1 entry from each duplicate. Also the plugin that is suggested (Cleanup Duplicate Meta) is exactly what I need, but it hasn't been updated for 7 years. The plugin tells me there are over a million duplicates, but when I click to clean it up, nothing happens.
Can someone confirm that
DELETE FROM `wp_postmeta` WHERE `meta_id` NOT IN (SELECT * FROM (SELECT MAX(`pm`.`meta_id`) FROM `wp_postmeta` pm GROUP BY `pm`.`post_id`, `pm`.`meta_key`) x)
will delete the duplicates but leave at least 1 entry of each?