class ActionController::Request # ActionController::AbstractRequest in Rails < 2.3 # Returns true if the request seems to come from a bot def bot? user_agent =~ /\b(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)\b/i end end # # Then in your controllers you can do : # # unless request.bot? # ... Log, stat ... # end