I've tried this for only one test user and it seems to work but you probably want to have a backup of your database first.
There's no function to mass delete users by a profile field, but you can prune users by usergroup. So you could do this:
- Create a temporary user group, note the id number.
- Execute this SQL query:
Code:
UPDATE user LEFT JOIN userfield ON (user.userid = userfield.userid)
SET user.usergroupid = X WHERE field1 = 'Man'
but replace X with the id of the temp group you created. (If your db has a table prefix you'll need to modify the query to include it).
- In the adminCP go to Users -> Search for Users and search for users in your temp user group, make sure the list of users looks like the ones you want to delete.
- Go to Users -> Prune/Move Users, select your temporary user group and enter '0' for the 'Has not logged on for x days' field. Press 'Find'
- On the next page select 'delete' and press the 'Go' button.