Comment spam: Trackbacks

Folks are whining about spam in comments.

I whine about spam sent by WordPress to me, containing links to the usual spam-bait.

So, today, I concentrated a bit, wandered in the (rather clean, for PHP) code, and found my line.

In the folder wp-includes/functions.php there is a function called

wp _ notify _ postauthor

Open that file, and look at line 976. There is a conditional there that checks if the variable comment_type is set to “trackback”. For me, the trackback notifications are the only spam-problem left, so I edited that elseif-part of the conditional to be only this:

       } elseif ('trackback' == $comment_type) {
            return false;
        } elseif ('pingback' == $comment_type) {

Now I might lessen the strain on my kind host’s server, and also get less spam. Was this helpful to you?