psql -h localhost -U listmonk -d listmonk -c "SELECT l.name, count(sl.subscriber_id) FROM lists l LEFT JOIN subscriber_lists sl ON sl.list_id = l.id GROUP BY l.name;"

Category: Listmonk & Newsletters

psql -h localhost -U listmonk -d listmonk -c "SELECT l.name, count(sl.subscriber_id) FROM lists l LEFT JOIN subscriber_lists sl ON sl.list_id = l.id GROUP BY l.name;"

Show subscriber counts for every list

Joins the lists and subscriber_lists tables to report how many subscribers each list holds, including lists with zero members via the LEFT JOIN. A subscriber counts once per list they are attached to. Confirm the numbers against the dashboard list stats when in doubt.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.