Created
December 2, 2017 17:44
-
-
Save tomfordweb/7bee0ec5637e332ac16f32769848b934 to your computer and use it in GitHub Desktop.
Delete duplicate posts for WP, but can be used for most anything. Worked very quickly on a 60k row wp_posts table.
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 FROM wp_posts | |
WHERE id IN (SELECT * | |
FROM (SELECT id FROM wp_posts | |
GROUP BY post_title HAVING (COUNT(*) > 1) | |
) AS A | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment