From http://www.tripwiremagazine.com/2010/06/how-to-effectively-bulk-delete-many-posts-in-wordpress.html