Log in

View Full Version : Remove Orphan Posts by deleted users


ovnnet
05-18-2008, 12:38 PM
How can i removes all posts that belong to users who no longer exist? Because i'm using some mods, if in threads which have post by n/a user, i will get error.

Thank you,

King Kovifor
05-18-2008, 12:48 PM
Do these posts still show up as their username? Or is it just "guest"?

ovnnet
05-18-2008, 01:29 PM
still show up with their name. but them dont have title, status, profile info and Posts: n/a

nexialys
05-18-2008, 01:31 PM
this is how the system behave actually, they never show like "guest" like King ask... Guests have usernames but no identification...

if you want to delete these posts, you will have to do them manually...

King Kovifor
05-18-2008, 01:33 PM
nex,

The old username is still stored within the database I believe. Which would mean a query would be able to mass remove these threads / posts.

ovnnet
05-18-2008, 01:46 PM
Can you tell me how to do it, King?

King Kovifor
05-18-2008, 01:54 PM
DELETE FROM `post` WHERE `username`='username_here';

Just add your table prefix to 'post' and change 'username_here' to the username. Also, you may want to run Maintenance -> Update Counters -> Remove Orphan Posts.

ovnnet
05-18-2008, 02:00 PM
I'm sadly to say: It's impossible. Not only one user with many post, add my case, many users with many posts. If i know there names so i think delete manually is better. Have any way to do it in my case? thank you.

Paul M
05-18-2008, 02:37 PM
DELETE FROM post WHERE userid = 0 will do it, but be very sure you want to do this, and make sure you backup the post table first. Sounds to me more like you should fix the mod, not be making mass deletions from your post table.