How to Use Drupal 7 Views to Count Content

Here's how to quickly use Views UI to count content in your Drupal database. You can then display the counts as Blocks or even pages or just use them internally as site admin. The only prerequisite is to have Views and VIews UI enabled.

  1. Create a new view of content (aka nodes). Leave out sorting! (Sorting/ordering won't be visible in the count anyways but can prevent counting from working.)
  2. Under Advanced settings, enable Use aggregation to Yes.
  3. Under FIELDS, only use one main field, such as a title or nid. There should be Aggregation settings next to it. Set this to COUNT.
  4. That's it. You can add FILTER CRITERIA to reduce the counted content. Don't add SORT CRITERIA. Paging/more is also not applicable here.

Add new comment