Blogs that monetize frequently find themselves unders attack by both comment and trackback spammers. Some of these spammers are stalkers, some are weirdos so obessed with paid posts they hit the bloggers site over and over and over to “punish” them for their paid posts. Theresa of Scribble Scratch recently described the symptoms at the postie board. What can you do? Well, of course, you should already be using Akismet, BadBehavior and Spam Karma; those will block a lot of spam. But sometimes even those don’t work completely. Both Tricia and Theresa notice some of this is flying past Bad Behavior. You can also use WP-Ban to ban certain IP’s after that IP spamming. But what happens when they change IP addresses? My suggestion is based on a trick I learned fromSpamHuntresses’ who blocks trackback spam .htaccess. She described how to do it for WP 1.5; I modified her method make it work for me, and to also catch the spammers using proxy servers. (I’ve also left Spamhuntress a question because I think we can block even more spam if we add a few more lines.) Anyway, give this a try because it may do the trick:
Here’s a suggestion thatmight work.
SetEnvIf User-Agent “Opera” trackers
SetEnvIf User-Agent ^$ trackers
Order Allow,Deny
Allow from all
Deny from env=trackers
# This blocks people leaving trackbacks by proxies.
# Some ISPs still leave trackbacks this way, but it’s mostly spammers.
RewriteEngine on
RewriteCond %{HTTP:VIA} ^.
RewriteRule .* - [L,F]
So, how does this block spam?
Well… no. Nothing can block everybit of trackback spam. But here is what it will block:
- It prevents anyone using a browser to get to wp-trackback.php. That file called to leave trackback spam- and it appears in my logs when I get a trackback. Trackbacks shouldn’t be left by browsers- but many spammers give it a try.
- It prevents anyone from accessing wp-trackback.php through a proxy server.
What else could be done?
SpamHuntress’s original code had a line like this “<Files trackback>” which I replaced with “<Files wp-trackback.php>”. The reason I did that is that <Files trackback> never blocked the spam for me. What I’ve found is that the set up she described blocked browsers from accessing addresses like this:
http://money.bigbucksblogger.com/trackback/
But not this:
http://money.bigbucksblogger.com/the_file_name/trackback/
And since my trackbacks look like the latter, not the former, her method didn’t help me. But using <Files wp-trackback.php> did help me — so it might help you.
Anyway, if you are having trouble with trackback spam, give my code a try. If it doesn’t work for you, maybe we’ll get lucky and someone who understands .htaccess a bit better can tell us how to fix the code and make it work for everyone. (Also, if it turns out the spam comes through pingbacks, we’ll need to hunt down another solution. )
Meahwhile, good luck!
I just found this in my referrals for scribblescratch.com! I’m going to give this a try and I’ll let you know how the .htaccess thing works out!
I’m not sure how it will work (or if it will) on the blog with the most severe problems because it’s on a windows server. I’ve had problems using .htaccess on it in the past but it never hurts to try!
Thank you, this is very appreciated!
Wow this is very useful information!
Thank you!.. and great blog!
I don’t know why, but even without PPP posts I’m getting targeted with trackback spam.
I’ll give this one a try for sure. Thanks for the info.
Does wordpress not first check for a link on the page of the URL provided? The plugin for NucleusCMS does.