Goodbye trackback spam

Regular readers may have noticed a plethora of trackback spam over the past few days. The flow should be stemmed and all back to normal. There is no need to have trackbacks per se but I like it. The problem lies in the trackback module's implementation of trackbacks as comments. They are automatically put in as published comments regardless of other settings (including the excellent spam system). By changing line 26 from:

$cid, $node->nid, 0, 0, $subject, $trackback->excerpt, variable_get('filter_default_format', 1), getenv("REMOTE_ADDR"), time(), 0, 0, '', $thread, $trackback_author, $trackback->url);

to:

$cid, $node->nid, 0, 0, $subject, $trackback->excerpt, variable_get('filter_default_format', 1), getenv("REMOTE_ADDR"), time(), 1, 0, '', $thread, $trackback_author, $trackback->url);

(It is the change of the 0 following time() to a 1 that does the trick. All trackbacks will now be put in moderation and only those you choose to publish will appear.)

Category: