1

I found many requests made from Russia targeting the file admin-ajax.php, my server is not working right now.

I am sure that this traffic doesn't come from normal users but a robot.

How to avoid processing these queries to save resources ?

5.188.203.23 - - [24/Sep/2017:02:18:36 +0200] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 1 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
1

You can use .htaccess to ban IP's that you don't want to access your website. If you are attacked from the same IP over the prolonged period of time, and with great frequency, banning the IP is the best solution.

Simples way to ban IP in .htaccess is (replace 123.123.123.123 with IP you want to ban):

Deny from 123.123.123.123

You can add multiple lines like this for multiple IP's. This works for Apache servers if you use some other server type, the method to ban IP's will be different.

But, before you do this, make sure you are really banning the malicious user that tries to do something bad. A better solution is to use some security plugin that can identify malicious or spam sources and ban them for you.

0

Right now (version 4.8) there is no simple way to do it without crippling the admin.

OTOH, processing an ajax request that basically does nothing has very little cost in CPU cycles (lighter than an uncached front page) and you can probably just ignore it. If your site goes down because of it you have some very bad code going on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.