Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
992 views
in Q2A Core by
My site has many spammers who just register and complete a profile including a link back to their desired spammy site. After that, they never come back again. Is there a way to automatically delete inactive users (specified time period)?
Q2A version: latest

1 Answer

0 votes
by

Just make sure this is logical explaination and never done practically yet but if get time than I will try.

What you can do by checking loggedin column value from qa_users table

Than calculate with the current date and so you can define something similar below

if(userlastloggedin > 30){

//add your delete user code

}

With this logic I believe you will be able to achieve what you are looking.... By the way I am adding this in my road map for future development.

by
You should check the "written" column, because you can log in and have it remember you permanently. Also you will want to also check that they don't have any posts, otherwise you might delete a good user with good answers who left the site.
by
@Scott,
Thanks for useful comment and pointing me in right direction.. just one confusion.. what if user never written anything? I mean user may logged in but never written anything yet even good user? In that case will this work properly? Suggest me please..
...