I am seeking to track some KPIs for my site, one of which is the number of activated, registered users there are on the site. Is there a way to get this number?


You can query the users table, counting the number of rows where status = 1, which will give you the number of active user accounts.


The Drupal way would be to use Views to create a report for yourself (I would avoid querying any tables in the db directly.)

If you don't have the Views module installed, download and install it from http://drupal.org/project/views.

Once installed, create a new View on the User object. You will be able specify which fields you want to display, sort order, and filters.

Depending on which version of Views you are using (might be Views 2 in Drupal 6) you may also need to use an additional module called Views Calc in order to get the count of records returned: https://drupal.org/project/views_calc

  • this looks promising - thank you! :) I much prefer doing it in a drupal way than querying tables in the db directly. – tobiaseigen Aug 23 '13 at 18:12
  • Thanks @tobiaseigen. If you think it's the best answer to your question, I'd appreciate it if you would identify that. – Ed McLaughlin Aug 27 '13 at 19:49

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.