Magento 2 SQL queries › Customers
How many newsletter subscribers do we have?
Short answer: Marketing › Newsletter Subscribers lists them; the query counts them per status and store view.
In the Magento admin
- Go to Marketing › Communications › Newsletter Subscribers and filter Status = Subscribed.
With one query
These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.
Works on Magento Open Source and Adobe Commerce:
SELECT CASE ns.subscriber_status
WHEN 1 THEN 'Subscribed' WHEN 2 THEN 'Not activated'
WHEN 3 THEN 'Unsubscribed' WHEN 4 THEN 'Unconfirmed'
END AS status,
ns.store_id,
COUNT(*) AS subscribers
FROM newsletter_subscriber ns
GROUP BY ns.subscriber_status, ns.store_id
ORDER BY ns.store_id, ns.subscriber_status;
Good to know
- Unconfirmed means double opt-in is on and the subscriber hasn't clicked the confirmation link yet.
- Guests can subscribe too; their
customer_idis 0.