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

XF 1.3 ACP "Banned Users" has entries for non-existant users

Kevin

Well-known member
#1
When viewing "Banned Users" in the ACP entries are showing with no user name. Clicking on the entry gives shows the xf_user_ban data. Clicking on "User Info" shows "The requested user could not be found" and looking in xf_user confirms that the user entry is not there.

So the question really is.... what's the best way of clearing up xf_user_ban to get rid of entries for users that don't exist? :D
 

Mike

XenForo developer
Staff member
#2
You could likely delete them with a query that left joined to the xf_user table and removed the ones without a matching user. I wouldn't totally recommend that just from an ease-of-mistakes perspective.

You may just need to remove them manually via the DB.
 

Kevin

Well-known member
#3
Because of the volume of entries, over 400, I went with a join on the delete command.
Code:
delete xfban
from xf_user_ban as xfban
left join xf_user as xfuser on xfban.user_id = xfuser.user_id
where xfuser.user_id IS NULL