2007
04.01

Aparte de Captcha!, para luchar contra el SPAM via trackbacks uso Trackback Validator, que funciona muy bien pero tiene un problema: independientemente de que el Trackback sea basura o no, lo recibo por correo si activo “enviar comentarios por correo” en el panel de administración. Así que puedes acabar con tu buzón de correo inundado de mensajes basura de trackbacks, aunque sean correctamente filtrados de tu blog.

Por ello le hice un pequeño hack, que corrige esto. De manera que los trackbacks que son SPAM no me llegan. Sólo los válidos.

Descárgala aquí.

Actualización: (2007-04-01) Parece ser que no soy el primero en hacer algo así. Aunque en este caso usan otra aproximación (hackear el WP directamente).

Share
  1. Thanks for the suggestion, but when I make that change, I get email again.

    Like or Dislike: Thumb up 0 Thumb down 0

  2. Jon, to me it’s updating (at least with valid trackback / pingbacks).

    Try changing the line which reads:
    wp_set_comment_status($comment_ID, 'delete');

    And put:
    wp_set_comment_status($comment_ID, 'spam');
    instead.

    Like or Dislike: Thumb up 0 Thumb down 0

  3. I like this hack, but is there a way to eliminate the email while still allowing the “trackback_graph” to be updated?

    Like or Dislike: Thumb up 0 Thumb down 0

  4. Alex, here you are:
    [code lang=”php”]
    10a11
    >
    135c136,139
    < --- >
    > if ($tb_info[‘comment_type’] != ‘trackback’) // Ensure it’s a trackback
    > return $comment_ID;
    >
    141c145,146
    < $wpdb->query(“UPDATE $wpdb->comments SET comment_approved = ‘1’ WHERE comment_ID = ‘$comment_ID'”);

    > //$wpdb->query(“UPDATE $wpdb->comments SET comment_approved = ‘1’ WHERE comment_ID = ‘$comment_ID'”);
    > wp_set_comment_status($comment_ID, ‘approve’);
    143c148,150
    < $wpdb->query(“UPDATE $wpdb->comments SET comment_approved = ‘spam’ WHERE comment_ID = ‘$comment_ID'”);

    > //$wpdb->query(“UPDATE $wpdb->comments SET comment_approved = ‘spam’ WHERE comment_ID = ‘$comment_ID'”);
    > // wp_set_comment_status($comment_ID, ‘spam’);
    > wp_set_comment_status($comment_ID, ‘delete’);
    145c152
    < update_comment_count($tb_info['comment_post_ID']); --- > //update_comment_count($tb_info[‘comment_post_ID’]);
    147c154
    < --- >
    297c304
    < add_action('trackback_post', 'tb_check',1,1); --- > add_action(‘comment_post’, ‘tb_check’);
    [/code]

    Like or Dislike: Thumb up 0 Thumb down 0

  5. So I just saw this link in my latest activity list. Could you post a diff from the original source? I’d love to see what exactly you did to get it to work without modifying WP itself.

    Like or Dislike: Thumb up 0 Thumb down 0