WordPress brute force attack is when bots automatically try thousands of username and password combinations on your login page. Even if the attack is not successful, each attempt will run PHP and the database on the server, slowing down the site and causing you to hit resource limits on shared hosting. Effective protection is not established with a single plugin, but with layers consisting of password, trial limit, two-step verification and server filter.

How to see the trace of the attack?

Access records in the hosting panel wp-login.php and xmlrpc.php Count POST requests to their addresses. A normal site will have several entries per day; If you see dozens of requests per minute, you are under attack. Security plugins also provide the same information by listing unsuccessful login attempts.

Layer 1: username and password

The first username the bots try is "admin". If you have an administrator account with this name, create a new administrator and delete the old one. Passwords must be at least 14 characters, random and not used anywhere else. Since author archive addresses can show the username, the difference between the display name and the login name also makes the job of bots difficult.

Tier 2: trial limit

Temporarily blocking the IP address after a certain number of incorrect attempts practically stops the automated attempts. For example, 20 minutes for five incorrect attempts and 24 hours for repeat attempts is a reasonable start. This feature is available in many security plugins; Be content with a single plugin, two plugins that do the same job will conflict.

Layer 3: two-step verification

Even if the password is compromised, it is not possible to log in without the verification code on the phone. Require two-step verification on all admin and editor accounts. Store backup codes in a safe place; These are the only ways to access the panel when the phone is lost.

Layer 4: xmlrpc.php

xmlrpc.php is a favorite gateway for brute force attacks because it can allow hundreds of password attempts in a single request. If you are not using a component that needs this file, such as Jetpack or a mobile application, you can turn it off at the server level:

<Files xmlrpc.php>
  Require all denied
</Files>

This rule is added to the .htaccess file and rejects all requests to the xmlrpc.php file at the server level. Since the request does not reach PHP, it does not put a load on the server.

Layer 5: server and CDN filter

The most efficient protection is for requests to never reach WordPress. Defining a rate limit or additional validation rule for wp-login.php in a layer like Cloudflare completely takes the burden of the attack off your server. It is also a powerful option to open the login page to specific IP addresses on sites managed from a fixed IP only.

Comparison of layers

PrecautionEffectServer load
strong passwordMakes prediction impossibleConstant
Trial limitStops automatic retrydecreases
Two-step verificationDisables the compromised passwordConstant
Server or CDN filterInterrupts the request before it reaches WordPressSignificantly decreases

Example scenario

Imagine that a corporate site running on shared hosting slows down every afternoon and receives a CPU warning from the hosting company. Logs show that wp-login.php received hundreds of requests per minute during the same hours. When a speed limit of CDN is placed on the login page and xmlrpc.php is closed, both warnings are stopped and the site returns to normal speed. The problem here is not the small size of the hosting package, but the unprotected login page.

Team and agency accounts

If more than one person is accessing the site, each person must have their own account and receive only as much authorization as they need. For an employee who enters content, the role of editor or writer, not a manager, is sufficient. Accounts opened to agencies or freelance developers should be closed when the work is completed. As the number of accounts decreases, the username that the attacker can try also decreases, and it becomes easier to read login records.

Common mistakes

  • Just changing the login address: The attack continues as long as xmlrpc.php remains open.
  • Using two security plugins at the same time: It causes conflicts and deadlocks.
  • Blocking own IP address: Add your office IP to the whitelist.

For general safety precautions WordPress security optimisation Read our guide. To install all layers of ingress protection WordPress security optimization service Check out our page.

Is changing the login address enough?

It stops most automated bots, but it is not a security measure alone. It should be used with a strong password and two-step verification.

Does a brute force attack slow down the site?

Yes. Each attempt runs PHP and the database; Intense attacks cause resource limits on shared servers.

How do I know if there is an attack?

In the access logs, a large number of POST requests arriving to wp-login.php and xmlrpc.php in a short time are signs of an attack.