Title: Delete Duplicate Posts From Like Category
Last modified: August 20, 2016

---

# Delete Duplicate Posts From Like Category

 *  [gward1](https://wordpress.org/support/users/gward1/)
 * (@gward1)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/delete-duplicate-posts-from-like-category/)
 * My website has about 200k posts so naturally there are bound to be some duplicates.
   I’ve found this bit of mySQL:
 * [code]
    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.id [/code]
 * Only problem is it deletes posts with like titles. This won’t do. Any idea how
   to modify this so it only deletes duplicate posts in each category?

Viewing 1 replies (of 1 total)

 *  Thread Starter [gward1](https://wordpress.org/support/users/gward1/)
 * (@gward1)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/delete-duplicate-posts-from-like-category/#post-2161783)
 * haven’t found any solutions online

Viewing 1 replies (of 1 total)

The topic ‘Delete Duplicate Posts From Like Category’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [gward1](https://wordpress.org/support/users/gward1/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/delete-duplicate-posts-from-like-category/#post-2161783)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
