Actually that was naive of me, and I now have figured out the problem, but not the fix. Here is what actually happens:
I upload items to website also, but sometimes in future the same exact item may be in the update, I would then end up with domain-name/item domain-name/item2 domain-name/item3 These are duplicates, I simply delete all these by running this 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;
This is what is deleting all the forum posts 100%, checked and tested it. The only thing is, I do need to run this. Is there a way to exclude in this code bbpress posts, or something?
I’d not suggest running anything like this but if it works well in your specific case, this should work:
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 and bad_rows.post_type NOT IN ('forum', 'topic', 'reply');
Hi Gautam, am going to give that a try, will let you know how I get on with it, thanks very much, appreciate 😉
I also just wanted to ask, is there a way I can update the current replies in forum to replicate what is really there. For example say I had deleted 13 replies in my previous error, forum still showing 13, is there a way to reset these numbers so all correct. As only other way I can think of is by starting everything again from scratch in forum.
Gautam worked like a dream, I can now operate bbpress exactly as I need, thank you 😉
Go to Tools -> Forum and recount. 🙂
Glad it worked.