-
-
Save phillipwilhelm/46bad083029dedf39a961cde9f320a3d to your computer and use it in GitHub Desktop.
WordPress find post duplicates via MySQL query - Used to remove duplicated posts from WordPress - i.e https://www.lipercubo.it, https://capolooper.it
This file contains 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
SELECT a.ID, a.post_title, a.post_type, a.post_status | |
FROM wp_posts AS a | |
INNER JOIN ( | |
SELECT post_title, MIN( id ) AS min_id | |
FROM wp_posts | |
WHERE post_type = 'post' | |
AND post_status = 'publish' | |
GROUP BY post_title | |
HAVING COUNT( * ) > 1 | |
) AS b ON b.post_title = a.post_title | |
AND b.min_id <> a.id | |
AND a.post_type = 'post' | |
AND a.post_status = 'publish' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment