This may sound paradoxal but here it is.

Membership based site.

A new user starts as suspended. An admin unsuspends.

The user uses the system.

If a membership expires, a user gets suspended again (in the cp).

I want (in the cp again, from a plugin) a list of of suspended users who have never logged in. New users basically...


Neither of these work. Any light?

Doing this


Then this in the actual loop works

 {% if user.lastLoginDate is null %}

I just wonder why I can't just fetch it all in one go :)


This probably works: craft.users.status('suspended').lastLoginDate(':empty:')

  • Perfect, this works just as I wanted :)
    – Oli
    Jun 8 '15 at 10:31

You should able to use search with craft.users something like this:

craft.users.search('suspended: 1 lastLoginDate: NULL')

See the search docs for more details.

  • Cheers for that, I'm not a massive fan of search for set things like this but this works too :)
    – Oli
    Jun 8 '15 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.