<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FiddyP &#187; email</title>
	<atom:link href="http://fiddyp.co.uk/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://fiddyp.co.uk</link>
	<description>The personal blog of Andy Bailey</description>
	<lastBuildDate>Sun, 13 May 2012 15:28:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to extract names and email addresses from your WP database</title>
		<link>http://fiddyp.co.uk/how-to-extract-names-and-email-addresses-from-your-wp-database/</link>
		<comments>http://fiddyp.co.uk/how-to-extract-names-and-email-addresses-from-your-wp-database/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 23:30:06 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[profit]]></category>

		<guid isPermaLink="false">http://www.fiddyp.co.uk/how-to-extract-names-and-email-addresses-from-your-wp-database/</guid>
		<description><![CDATA[I had to do some playing around with my wordpress database when I wanted to move my install from a shared hosting to a dedicated server (which turned [..]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ffiddyp.co.uk%2Fhow-to-extract-names-and-email-addresses-from-your-wp-database%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ffiddyp.co.uk%2Fhow-to-extract-names-and-email-addresses-from-your-wp-database%2F&amp;source=commentluv&amp;style=normal&amp;service=bit.ly&amp;service_api=R_259b4e5679e2c431cca1f989e158bba4&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I had to do some playing around with my wordpress database when I wanted to move my install from a shared hosting to a dedicated server (which turned out to be quite easy!) and I went in a bit further to phpmyadmin to see what other things I could do.</p>
<p>With the current release of my new contest game, <a href="http://www.fiddyp.co.uk/play-aqua-game-and-win">Aqua Craft</a>, I wanted to let everyone that has visited here know about it and rather than wait for every single commenter to come back and see the post, I thought it might be easier to extract the email addresses of all commenters from the database and send them all a message. (luckily, only one person replied saying it was spam!).</p>
<p>I checked my wp_comments table and it had a few thousand entries, yey! I thought. I&#8217;ll send them all a message! I extracted the table into a csv file and was disappointed to see literally hundreds and hundreds of spammer email addresses in there&#8230;</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/rawphpmyadlist.jpg' title='wp_comments table with spam addresses'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/rawphpmyadlist-150x150.jpg' alt='wp_comments table with spam addresses' /></a></p>
<p>Not being a mysql database geek, I did some searching and found a way to extract all the addresses of the commenters that had been approved&#8230; here&#8217;s how&#8230;</p>
<p>1.) Log in to phpmyadmin<br />
2.) select the wp_comments table on the left and click the &#8220;browse&#8221; button on comment_author_email</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/phpmyadtable.jpg' title='phpmyadmin wp_comments table'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/phpmyadtable-150x150.jpg' alt='phpmyadmin wp_comments table' /></a></p>
<p>3.) Click &#8220;edit&#8221; on the mysql statment at the top of the page and change it to the following</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/selectcsv.jpg' title='edit mysql statement'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/selectcsv-150x150.jpg' alt='edit mysql statement' /></a></p>
<p>SELECT * FROM `wp_comments` WHERE `comment_approved` = &#8217;1&#8242;</p>
<p>That will show you a list of all the comments made that have been approved.</p>
<p>4.) Click on the &#8220;export&#8221; tab and select these options..</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/exportcsv.jpg' title='export approved comments'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/exportcsv-150x150.jpg' alt='export approved comments' /></a></p>
<p>This will give you a large .csv file ready to be opened by Excel</p>
<p>5.) Open the file in excel which will give you this..</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/rawcsv.jpg' title='raw csv file'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/rawcsv-150x150.jpg' alt='raw csv file' /></a></p>
<p>This is a lot more than we need, so delete the columns for comment id, comment content etc so you&#8217;re left with comment_author, comment_author_email and comment_author_url</p>
<p>6.) Your excel file should look like this&#8230;</p>
<p><a href='http://fiddyp.co.uk/wp-content/uploads/2008/03/fixedcsv.jpg' title='Fixed csv file'><img src='http://fiddyp.co.uk/wp-content/uploads/2008/03/fixedcsv-150x150.jpg' alt='Fixed csv file' /></a></p>
<p>Now there will be a lot of duplicate email addresses from multiple commenters but if you have a decent newsletter or mass email program, you should be able to import this file and let it filter out all the dupes and discard the trackbacks and pings.</p>
<p>Easy peasy! I ended up with a few hundred email addresses who I could tell about my latest contest.. awesome&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://fiddyp.co.uk/how-to-extract-names-and-email-addresses-from-your-wp-database/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

