Created
October 20, 2011 14:07
-
-
Save willcritchlow/1301218 to your computer and use it in GitHub Desktop.
SQL for getting WordPress commenters' email addresses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select a.comment_author_email, max(a.comment_date) as date, b.comment_author from wp_comments a, wp_comments b where a.comment_author_email = b.comment_author_email and a.comment_date = b.comment_date and a.comment_approved=1 and a.comment_author_email <> "" and a.user_id = 0 and a.comment_author_email not like '%YOUREMAILDOMAIN%' group by a.comment_author_email; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are running mysql on the command line and you save this file as wp-commenters.sql you can output to a tab-separated file with:
mysql -u root -p db_name < wp-commenters.sql > wp-commenters.tsv