Skip to content

Instantly share code, notes, and snippets.

@RafaelFunchal
Last active August 29, 2015 14:03
Show Gist options
  • Save RafaelFunchal/c1e2db8fe5093fba20e7 to your computer and use it in GitHub Desktop.
Save RafaelFunchal/c1e2db8fe5093fba20e7 to your computer and use it in GitHub Desktop.
SQL to unsubscribe inactive subscribers, never opened and never clicked in MailPoet
UPDATE wp_wysija_user as A
JOIN (
SELECT user_id
FROM wp_wysija_email_user_stat
GROUP BY user_id
HAVING SUM(status) <= 0
) B ON A.user_id = B.user_id
SET A.status = -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment