- b2evolution CMS User Manual
- Operations Reference
- Fighting Spam
- How to control referrer spam hits from search engines
How to control referrer spam hits from search engines
This refers to b2evolution versions 0.9.0.*
Are you getting traffic from search engines for something that a referer spammer faked into your stats page? Would you like to keep your referer data and stats page visible to visitors but stop the undesirable traffic? If so this is the place for you.
Referrer spammers use a couple of methods to find you, and a big one is using the search engines. They look for "top referrer" and "recent referrer" and "disp=stats" knowing that if you have those then you are a b2evolution user and that they can spam you. The solution is three parts, the first two of which are normal everyday b2evolution stuff.
First always keep your antispam table up to date. In your back office click the antispam tab then click Request abuse update from centralized blacklist. Your antispam table will be compared to the community-based version then updated. You will see some things that are added and some that are already handled, then it will tell you it's done. If this is your first time getting the update you should do it again and again until the update doesn't have any new sites to add (or identify as already handled) so that you get ALL the available updates.
Next you need to clear the existing spammers out of your referrer logs. In your back office click on the stats tab. On the "View stats for blog none and referers tab scroll to the bottom of the page and take a look at the Top referers section. If you see some undesirable site in your Top referers section click the "ban" symbol next to their name. You will be taken to your antispam section. Your hit logs and comments will be searched for undesirable domain names, and if found they will be listed for you. You will then have up to 4 checkboxes for you to (1) delete the hits (if there were any), (2) delete the comments (if there were any), (3) ban the domain locally, and (4) report the domain to the central blacklist.
Do it. Click <strong>Perform selected operations</strong> to delete them, ban them, and report them.
Now that you've cleaned up your referer data and stats page the next thing to do is to stop the search engines from sending you traffic you don't want. The problem is you can't really do that as long as they have your page indexed. The solution is to control what they index, and this involves editing your _main.php file in your default skin. Open skins/skinname/_main.php in your favorite editor and look for
<meta name="keywords" content="<?php $Blog->disp( 'keywords', 'htmlattr' ); ?>" />
<meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
<link rel="alternate" type="text/xml" title="RDF" href="<?php $Blog->disp( 'rdf_url', 'raw' ) ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php $Blog->disp( 'rss_url', 'raw' ) ?>" />
Now you add a "robots noindex nofollow" tag for the stats page by adding a conditional statement about $disp:
<meta name="keywords" content="<?php $Blog->disp( 'keywords', 'htmlattr' ); ?>" />
<meta name="generator" content="b2evolution <?php echo $b2_version ?>" /> <!-- Please leave this for stats -->
<?php if( $disp == 'stats' ) { // stop search engines from indexing the stats page
echo '<meta name="robots" content="noindex, nofollow" />'."\n";
} ?>
<link rel="alternate" type="text/xml" title="RDF" href="<?php $Blog->disp( 'rdf_url', 'raw' ) ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php $Blog->disp( 'rss_url', 'raw' ) ?>" />
It will take a while for this to help because you have to wait for the search engines to index your blog again. In the mean time keep your antispam table up to date by getting the updates, and keep your stats clean by checking your stats page for suspicious activity. A domain name that suddenly shows up in the top of your Top referers section is suspicious!
By the way spammers aren't always porn sites. A spammer is someone who fakes referer data to get on your referer list. If you see a suspected spammer you might want to visit the site to make sure before reporting them. Sometimes I do, but only if the name isn't obviously unrelated to the things I blog about.