• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Need a way to mass-delete attachments for one user

Rudy

Well-known member
#1
We have a user who has made some questionable posts with attachments (who has since been banned), but we need a way to quickly remove all of his attachments.

Is there a query or two I can make in the database to properly attend to this? Or, a PHP script that I can use to also make certain that the files are deleted as well? I'm sure someone has probably done this in the past, and time is of the essence (in other words, it has to happen ASAP for legal reasons--can't be waiting for add-ons or new features to be added).
 

Rudy

Well-known member
#3
Sorry, I should have mentioned that won't work--I can't find any staffer who wants to delete 900+ attachments by hand that way. I did two pages' worth a couple of months ago when this all started, and got a bit pickled with how inefficient the system is for this sort of thing.

I guess I could say we are now in a "triage" mode with this member.
 

Brogan

XenForo moderator
Staff member
#4
If it's urgent then that is your only option currently.

Each page lists 50 attachments so selecting all means you can do it with 18 separate operations, which should only take a few minutes at most.