In one of my Drupal 6 installations there are thousands of users who have registered with the site but haven't contributed. I want to do a DB cleanup and delete these users. Is there a way to filter it such that:

I want to delete the users who:
* haven't been active for more than 1 years
* AND have no posts or comments published on the site

User management site (/admin/user/user) doesn't offer this kind of granularity. Any suggestions?

Comments

The following module allows you to delete users based on a criteria you specify:

https://drupal.org/project/user_prune

Hope this works for you.

Regards

www.tmdhosting.com
---------------------
Drupal Hosting, Free Drupal Installations, Free Module and Theme Installations, Free Upgrades, Free Drupal

Thank you for the reply. According to the description of the module, there is no criteria based on the number of posts/comments the user have contributed. I would like to keep a user account if there is even one post/comment submitted from that account. This module doesn't seem to do that or am I missing something? I'll install the module later today and see if it provides the functionality.

Hello

You said that you would like to delete users who:

* haven't been active for more than 1 years
* have no posts or comments published on the site

Using the module you can:

- You can filter by users who have been registered for number of weeks,months,years
- You can filter by users who haven't logged in for number of weeks,months,years

I assume that the second option would work as in order to determine if the user was active he or she would need to login the site. If the user have not logged, obviously he was not active.

As for the posts, I assume that only registered users can post on the site. If I am not correct on that one, you may search for different module that would help you achieve your goal.

Regards

www.tmdhosting.com
---------------------
Drupal Hosting, Free Drupal Installations, Free Module and Theme Installations, Free Upgrades, Free Drupal

Sorry, I think the miscommunication is a result of my poor wording. I meant "users who haven't been active for more than 1 years AND have no posts or comments published on the site". A user with a post or a comment should not be deleted even if (s)he is not active.

Hi,

You can set rules for it to delete those user's. You can check the condition in rules like user last login date is > 1 yr and no. of posts == 0 or no. of comments ==0 then delete that user account.
Rules is the best option for this.
Please let me know if you want more detailed information about how to write rules?

Thanks,
Shubhangi.