[wp-hackers] WP and spam

Viper007Bond viper at viper007bond.com
Tue Mar 18 06:10:35 GMT 2008


On the "Recent Spam Harvest" screen, there's a checkbox to automatically
purge spam over X days old.

On Mon, Mar 17, 2008 at 11:06 PM, Mr. Awesome <
theone.andonly.mr.awesome at gmail.com> wrote:

> Viper007Bond wrote:
> > Oh, sweet irony! :o
>
> LoL! Since we're using that plugin for SK2... is there already code
> there for this, or could there be a way to just add this to the plugin
> file...
>
> function akismet_delete_old() {
>    global $wpdb;
>    $now_gmt = current_time('mysql', 1);
>    $wpdb->query("DELETE FROM $wpdb->comments WHERE DATE_SUB('$now_gmt',
> INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'");
>    $n = mt_rand(1, 5000);
>    if ( $n == 11 ) // lucky number
>        $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
> }
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/


More information about the wp-hackers mailing list