How To Crush WordPress Trackback Spam
Since upgrading to WordPress 2.3.2, the webserver that hosts my blog has taken a beating from trackback spammers.
The trackback requests were prevalent before, but for some reason they weren’t slowing the server down until the upgrade.
After trying many solutions, I finally found a way to solve the problem. This will no longer allow you to have trackbacks on your blog, but if you have to decide between no blog or no trackbacks then I’m sure you’ll have no problem implementing this.
Basically you just update your index.php to the following:
if ( preg_match('/trackback/', $_SERVER['REQUEST_URI']) ) {
die();
} else {
/* Short and sweet */
define('WP_USE_THEMES', true);
require('./wp-blog-header.php');
}
?>
You might need to modify the preg_match() so that you don’t cut off legit posts that have trackback in the name, but the blog I use this code on does not have such posts.
Hopefully some day soon these spammers will realize they’re doing no one any good.
If you enjoyed this post, get free updates by email or RSS.

























Checkout These Related Posts
Leave a comment
Pingbacks/Trackbacks