Designing the future of your business!

How to get rid of duplicate posts in WordPress with MySQL Query.

Posted September 7th, 2011 by Dimitar with No Comments

Remove Duplicate Posts in WordPress

1. Login to phpMyAdmin

2. Click on SQL tab

3. Copy and paste this in the query box.

DELETE bad_rows.* from wp_posts as bad_rows inner join ( select post_title, MIN(id) as min_id from wp_posts group by post_title having count(*) > 1 ) as good_rows on good_rows.post_title = bad_rows.post_title and good_rows.min_id <> bad_rows.i

4. Click Ok

It should display the number of duplicated entries removed.

Leave a comment