Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Post-import cleanup help needed

@pixelnated

Participant

If it helps anyone this will help you see all your bbpress duplicate topics at a glance with the duplicate ID
** Note these are just selects so they will not delete any data **


select 
		post_type
      , post_date
      , post_title
      , post_content
      , max(id) as dup_id, 
      count(*) as dupe_count
from 
		wp_posts 
where 
		post_type in ('forum', 'topic', 'reply')
group by 
		post_type
      , post_date
      , post_title
      , post_content
having count(*) > 1
order by post_type, post_date, dup_id

We can then take a variation of that and have it give us the start and end duplicate ranges for each post_type with counts of rows we expect to be impacted.


select post_type, min(dup_id) as start_dup, max(dup_id) as last_dup, count(*) as total_recs
from 
(
select 
		post_type
      , post_date
      , post_title
      , post_content
      , max(id) as dup_id, 
      count(*) as dupe_count
from 
		wp_posts 
where 
		post_type in ('forum', 'topic', 'reply')
group by 
		post_type
      , post_date
      , post_title
      , post_content
having count(*) > 1
) i
group by post_type

of course you need to verify but this should help get you on your way

Skip to toolbar