This trick has been discussed in the WordPress Codex and the Support forums but I’d like to echo it here again for those who haven’t had the chance to learn about it and still suffering from comment, track-back and referral spam.
If you’re using the WP ShortStats plugin, you’d have noticed by now that you’re getting referrals from sites that targets your wp-comments-post.php which shouldn’t be the case because they’re internal WordPress files. This is an indication that your blog is being targetted for referral spam or trackback spam.
One of the earlier fixes I added in my .htaccess was a rewrite rule to supposedly block the referral spam:
RewriteCond %{HTTP_REFERER} “!^http://www.yugatech.com/blog/.*$” [NC]
RewriteCond %{REQUEST_URI} “.*wp-comments-post.php$”
RewriteRule .* – [F]
That seemed to help stop it by about 90% or so which is quite effective IMO. Still there’s the trackback spam to consider, so here’s one tip you can implement in your WP theme:
1) Find the file wp-comments-post.php and rename it to something else (e.g. i-get-no-spam.php). This file can be found in your root WP folder.
2) Next, look for the file comments.php in your active WP theme folder and edit instances of the term “wp-comments-post.php” to match that of what you renamed it to.
If you’re running some other comments related plugin, like Paged Comments, there might be some slight changes in the steps but that’s the general idea.
That’s it. Now them spam bots that have bookmarked your wp comment form would get a 404 error next time.


I always spent my half an hour to read this weblog’s content all the time along with a mug of coffee.