Recently there’s been an annoying rise in the amount of referrer spam targeting sites on my server, so I decided to do something about it.
ReferrerCop will parse your Apache log files or AWStats data files and remove entries for referrers that match a big list of known referrer spammers. The filtered files are returned via standard output. By running your logs through ReferrerCop either before or after they’ve been processed by AWStats (or the log analysis software of your choice), you can eliminate annoying referrer spam from your web statistics.
If you know Ruby, you can also use ReferrerCop’s filtering capabilities in your own programs simply by including the ReferrerCop module.
If enough people start using this, I’d like to add features for automatically updating the blacklist and for performing a wider range of tasks (including filtering more log file formats).