Add-On to Delete Idle Registrations?

Comsup

Member
Licensed customer
Although I like to see the membership of my site increase, I am looking for a way to control members who register and then are never seen again.

In particular, if a member's "last activity" date is less than X days after their "registration date", I want to automatically place the account into an "inactive" state or possibly just delete the account. Perhaps even keep the username in a table so that it can't be used again to register.

I would also want to be able to exempt specific members, such as a member with an active upgrade or who is a member of a specific secondary user group.

I've seen add-ons that will delete users or change user state if there is no activity after X days, but none that check for activity based on registration date.
 
Thanks Andy. This will work if the user never posts, but I'm trying to catch users who register and never even come back within X days after registering.
 
I'd generally avoid deleting users since you loose the historic data for dual registrations and so forth then, but if you just want to find users who register and do nothing a database query can get them quite easily.
SQL:
select  user_id,email,username,message_count,FROM_UNIXTIME(register_date),FROM_UNIXTIME(last_activity),user_state 
  from xf_user
  where register_date = last_activity
  and user_state not in ('rejected','disabled');
Will give you those users who are not already rejected or disabled. If you just wanted those that were valid users you could tweak the last clause.

You could if you wanted combine that to update their user_state to something like 'disabled'. I will however say I don't know if when you set a user account state via the admin control panel it does other magic elsewhere of if the user_state field is the only thing updated. You could probably make the adjustment via the API which would cover off any other "magic" if you're scripting.

Still for the sake of a complete answer the destructive (so caveat emptor and all) to update users as described to have a disabled state would be:
SQL:
update xf_user
  set user_state = 'disabled'
  where register_date = last_activity
  and user_state not in ('rejected','disabled');

Again tweaking the last clause as desired. You probably don't want to alter rejected users, but maybe you don't want to update those pending email verification, etc.
 
Although I like to see the membership of my site increase, I am looking for a way to control members who register and then are never seen again.

In particular, if a member's "last activity" date is less than X days after their "registration date", I want to automatically place the account into an "inactive" state or possibly just delete the account. Perhaps even keep the username in a table so that it can't be used again to register.

I would also want to be able to exempt specific members, such as a member with an active upgrade or who is a member of a specific secondary user group.

I've seen add-ons that will delete users or change user state if there is no activity after X days, but none that check for activity based on registration date.
You can accomplish most of this manually using XenForo’s built-in Batch Update Users tool in the Admin CP. While it won’t automatically run based on registration vs last activity, it can still filter users who registered but never returned.
 
... but if you just want to find users who register and do nothing a database query can get them quite easily.
select user_id,email,username,message_count,FROM_UNIXTIME(register_date),FROM_UNIXTIME(last_activity),user_state
from xf_user
where register_date = last_activity
and user_state not in ('rejected','disabled');
The above code appears to return only users whose registration date and time match their last activity date and time. If their last activity was, for example, an hour after registration, then this code would not find them. I'm trying to find users who register, maybe come back the next day to check to see if they've been dumped, and then go underground.
 
I would also want to be able to exempt specific members, such as a member with an active upgrade or who is a member of a specific secondary user group.
If you are willing to fund the development of this add-on please feel free to hit me up with a dm.
 
I would pose a counterpoint as to why you want to do this?

Are you out of space?
are you having performance problems?

What is the actual problem you are trying to solve?


There's not a really good reason to delete things like this IMO. I've registered for sites and don't go back for 12 years some times.
 
I would pose a counterpoint as to why you want to do this?

Are you out of space?
are you having performance problems?

What is the actual problem you are trying to solve?


There's not a really good reason to delete things like this IMO. I've registered for sites and don't go back for 12 years some times.
The problem is that people will create multiple sleeper accounts, surface to create problems, get banned, and then return later with another sleeper account. On my site, if you lurk, you’re out.
 
What I would do in this case is create a usergroup promotion.
easy criteria:
1773864259041.webp

promote them to a restricted usergroup where there posts/etc need to be approved by a moderator.
 
make a 'banned' user group that has no permissions to do anything
promote users to that group based on criteria.

they won't be able to do anything but log out.
 
The problem is that people will create multiple sleeper accounts, surface to create problems, get banned, and then return later with another sleeper account. On my site, if you lurk, you’re out.
I have coded an add-on that will detect all multiple accounts. You can see it here should you be interested.

 
The above code appears to return only users whose registration date and time match their last activity date and time. If their last activity was, for example, an hour after registration, then this code would not find them. I'm trying to find users who register, maybe come back the next day to check to see if they've been dumped, and then go underground.
Then you'd have to tweak the code suitably to do a range check between registration and last activity. Perfectly possible, if so inclined. However it looks like Andy's add-on does more or less exactly what you want so no need to meddle directly with the data!
 
Back
Top Bottom