From 655a8d55a207866b5b00df5e6e353b1528b5bed8 Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Fri, 28 Jul 2017 22:31:14 -0700 Subject: [PATCH] Ignore reporting 404 when it is likely bots trying to hack wordpress. Bots gonna bot. --- config/initializers/05-airbrake.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/initializers/05-airbrake.rb b/config/initializers/05-airbrake.rb index 455bd3e..7a71dde 100644 --- a/config/initializers/05-airbrake.rb +++ b/config/initializers/05-airbrake.rb @@ -7,4 +7,9 @@ use Airbrake::Rack::Middleware enable :raise_errors + + Airbrake.add_filter do |notice| + # Bots gonna bot + notice.ignore! if notice[:errors].any? { |e| e[:type] == "Sinatra::NotFound" } && /\/wp-(?:admin|includes|content|login)/ =~ notice[:context][:url] + end end