WordPress admin site login url is /wp-login.php by default. It is known by all bots, hackers and other spam software which can take a brute force attacks to your website. If you find there are so many records ( ie : 184.108.40.206 – – [29/Nov/2020:00:20:53 -0700] “POST /wp-login.php HTTP/1.1” 200 ) in your website access log, it means your website is under attack by bots. This can cost a lot of your website bandwidth and slow down your web server.
There are two ways to fix such issue. One is to install a third party plugin ( for example : WPS Hide Login ) to hide the default WordPress admin login page url. But if you use this method, you have to remember another WordPress login page url, and the bots request will arrive your web server to give your web server so much spam requests pressure to slow down it’s performance.
We have another method to avoid such attacks without install plugin. In this method, the bots request will never arrive your web server at all, so it can improve your website speed and performance largely. And the login page url is not need to be changed also, you can remember it easily. Now I will tell you how to do it.
1. Use CloudFlare Firewall Free Rules To Avoid /wp-login.php /wp-admin Attacks.
- First you should use CloudFlare CDN service to your web site (Read article CloudFlare Plus SSL To Make Your WordPress Fast And Secure ).
- Login to CloudFlare admin console.
- Click Firewall button at top navigation bar, then click Firewall Rules link under Firewall button.
- Create a new firewall rule by click Create a Firewall rule button.
- In the create new firewall rule page, enter Block bot request to /wp-login.php and /wp-admin in Rule name input text box.
- Add two incoming request match condition, one is Field(URI) Operator(contains) Value(/wp-login.php), the other is Field(URI) Operator(contains) Value(/wp-admin). The two incoming request conditions are Or relation.
- Select Challenge(Captcha) in the bottom Choose an action drop down list. Click Deploy button to deploy it.
- Now when a client request /wp-login.php or /wp-admin, it will prompt a Captcha window to verify that the client is a human not a bots. All bots request are stopped at CloudFlare server and never arrive your original web server.