Over the past couple of weeks the amount of spam hitting this site has gone crazy. At the start of December, the total amount of spam comments caught by Akismet was around the 2,500 mark. That was all the spam I had received in an entire year. In the space of a couple of weeks, this jumped to nearly 8,000 spam comments.
The vast majority of this spam was in the form of trackbacks. Although Akismet was great at catching these unwanted trackbacks, it was becoming a pain checking and deleting hundreds of spam comments every day. So I’ve disabled trackbacks on this blog.
As I still wanted legitimate pingbacks to get through, it wasn’t as easy as disabling trackbacks in the Administration panel. The trick is to delete the wp-trackbacks.php file – found in the WordPress root directory. Just deleting the file though brings it’s own problem – if a legitimate reader clicks the “Trackback URI” link, then they’ll be greeted with a page of PHP errors. It doesn’t look great, and certainly doesn’t look professional.
The full solution is to delete the original wp-trackbacks.php file and create a new one with a message explaining that trackbacks have been disabled.
In order to integrate the new file into the site template, I used the <?php get_header();?> WordPress function. You can see the full effect by clicking the Trackback URI for this post.