Attacks on wp-login.php and XML-RPC: How to Spot Password Guessing and Stop It
In short: WordPress password guessing goes through wp-login.php and xmlrpc.php, and XML-RPC allows hundreds of attempts in a single request. You recognise it by large numbers of POST requests to those addresses in the server logs. The best protection is layered: two-factor login and strong passwords, limited login attempts, XML-RPC switched off if unused, and traffic filtered before it reaches WordPress.
If you have ever turned on notifications for failed logins on a WordPress site, you were probably surprised: attempts arrive constantly, from IP addresses all over the world, with usernames like “admin”, “administrator” or your company name. This is not an attack aimed specifically at you. These are automated bots that crawl millions of sites day and night trying to guess a password.
Most of those attempts fail. But it only takes one to succeed, on an account with the administrator role. And even failed attacks have a cost: they use server resources, slow the site down and can lead your host to temporarily throttle or block your account. In this article we explain how these attacks work, how to recognise them in the logs, and how to build protection that stops them before they reach WordPress.
Two kinds of attack: guessing and reusing passwords
Password guessing (brute force) means a bot tries a large number of passwords for one username, usually from a list of the most common passwords and their variations. Short, predictable passwords, such as the company name plus a year, fall quickly.
Reusing leaked passwords (credential stuffing) is the more dangerous variant. The attacker has lists of email addresses and passwords that leaked from other services and tries them on your site. If an administrator used the same password on a forum or online shop that was breached, the attacker may have it before the first attempt. Another way passwords get stolen is fake emails posing as WordPress.
In both cases the targets are the same: the login form at wp-login.php and the xmlrpc.php interface.
Why XML-RPC is especially attractive to attackers
XML-RPC is an older interface that lets outside programs talk to WordPress: publishing from the mobile app, some old writing tools and a few plugins. It logs in with a username and password. The problem is a method that lets several calls run inside a single HTTP request. In one request an attacker can try hundreds of combinations, while protections that count requests see only one.
XML-RPC can also be abused for so-called pingback attacks, where your site is used to send requests to other sites. If you do not use XML-RPC, there is no reason to leave it open.
What an attack looks like in the logs
The most reliable evidence of an attack is in the server access log, which most hosts provide in the control panel or over SSH. Every request has its own line: IP address, time, method, address and the server’s response. With password guessing you will see many POST requests to /wp-login.php or /xmlrpc.php from a small number of IP addresses or, in distributed attacks, from many different addresses each trying a few times.

If you have command-line access, a single command counts attempts per IP address and immediately shows how big the attack is. Without a command line you can download the log, open it in any spreadsheet program and filter the lines that contain wp-login.php.
With XML-RPC, also look at the size of the requests. A normal request has a small body, while a request trying hundreds of passwords will be unusually large.

Signs you notice without logs
- The site is slow at times, especially the admin area, without any increase in real visitors.
- Your host reports exceeded resources or temporarily throttles the account because of too many processes.
- Emails arrive about locked accounts or password resets you did not request.
- A security plugin records thousands of failed logins a day.

A rise in attempts on its own is not proof the attack succeeded. But if at the same time you notice a new administrator, changed settings or unknown files, assume the attacker got in and start a review of the whole site.
How attackers learn usernames
To guess a password, the attacker needs a username. WordPress can reveal it in several ways: through the author archive address (?author=1 redirects to /author/username/), through the REST API, which by default lists authors with published content at /wp-json/wp/v2/users, and through error messages on the login page.
Hiding usernames does not stop the attack on its own, but it shrinks it: a bot that does not know the name has to guess both name and password, which is incomparably harder. It also helps if the login name differs from the name displayed next to articles.
Layered protection
No single setting solves everything. The best result comes from several layers, each of which stops part of the attack:

1. Filtering before the server
A web application firewall (WAF), whether as a service in front of the site or as part of your hosting, can recognise and reject known attack patterns before they reach your server. This is the most effective layer, because the requests use none of the site’s resources. Check whether your host offers one with our 12 questions for choosing secure hosting.
2. Server-level rules
If you do not use XML-RPC, block it at web server level. In the same place you can limit the number of requests to wp-login.php per IP address per minute. Such rules run before PHP, so the attack does not load the database. On Apache and LiteSpeed the rules go in .htaccess; on Nginx they go in the server configuration, which is usually done by the host.

3. Limiting attempts in WordPress
Security plugins and some hosts offer a limit on failed logins with a temporary block of the IP address. It is a useful extra layer, but it only kicks in once the request already reached WordPress, so on its own it does not solve the load problem.
4. Strong and unique passwords
A long, random password from a password manager is practically impossible to guess. It must be unique, because against reused leaked passwords length does not help if the same password has already leaked somewhere.
5. Two-factor login
A second factor, an authenticator app or a security key, stops the attack even when the password is known. For administrators and editors it should be mandatory.
6. Least privilege
The fewer accounts have the administrator role, the fewer accounts are worth attacking. Remove accounts of former contractors and agencies as soon as the work ends.
A real-world example: a small company site
Take a typical situation: a company site with a dozen pages, a blog and a contact form, on shared hosting. The owner gets in touch because the site has been slow for a few days and the host has sent a warning about exceeded CPU time. Visitor numbers in analytics have not changed.
The access log for the last 24 hours shows several tens of thousands of POST requests to xmlrpc.php from a few hundred different IP addresses, and a smaller number of requests to wp-login.php. Each request starts PHP and a database query, so the server spends its resources rejecting passwords instead of serving the site to visitors.
The fix in that case has three parts. First, XML-RPC is blocked at server level because the site does not use it; the load drops almost immediately. Second, wp-login.php gets a per-IP rate limit and administrators get two-factor login. Third, we check whether any attempt succeeded: the administrator list, file modification dates and successful logins in the log. If everything is clean, the job is done in an hour. If not, a cleanup follows.
This example shows why the order matters. A security plugin that only recorded failed logins would not have fixed the slowness, because the requests would still reach PHP. Protection at server level solves both the security and the load.
What makes a good administrator password
A good password is long, random and unique. Length matters more than special characters: a password of twenty or so random characters, or a phrase of five or six unrelated words, is far stronger than a short password with an exclamation mark at the end. Most important is that it is not used anywhere else. A password manager solves both remembering and uniqueness, and most of them now work on computer and phone.
Avoid passwords that contain the company name, the domain, the founding year or the owner’s name. Those are exactly the details attack tools combine first, because they can read them from the site itself.
Does changing the login address help?
Plugins that move the login page from wp-login.php to another address reduce the number of automated attempts, because most bots look for the standard address. That is a useful extra, but not protection in itself: an attack through XML-RPC still works if it is not switched off, and the address can be discovered. Treat it as reducing noise in the logs, not as a replacement for two-factor login.
What if you need XML-RPC?
Some services and apps use XML-RPC, for example older mobile publishing apps or certain plugins that connect to external services. In that case, do not switch it off completely but restrict it: allow access only from the IP addresses of the services that use it, or switch off only the method for multiple calls. For new integrations it is better to use the REST API with application passwords, which can be revoked individually and do not expose the user’s main password.
When password guessing means you need a cleanup
If you suspect an attempt succeeded, check three things: is there an administrator you did not add, does the log show a successful login (a redirect to wp-admin after a POST request) from an unknown IP address, and were theme or plugin files changed around that time. If the answer to any of these is yes, change every password, log out all sessions by replacing the security keys, and review the site for backdoors. If the attacker could see orders or users, also check your GDPR reporting obligations.
For a quick look at how the site appears from outside, run the free check. For an inside review and cleanup, prices are listed in the price list, and urgent cases are handled the same working day.

Conclusion
Password guessing is the constant background noise of the internet and cannot be prevented entirely. It can, however, be made completely harmless: filter requests before the server, switch off XML-RPC if you do not need it, limit attempts, and protect accounts with unique passwords and a second factor. Once those layers are in place, failed logins in the logs become statistics rather than a reason to worry. A good next step is security HTTP headers, which protect visitors on the browser side.
FAQ
Is it normal to have thousands of failed logins a day?
On a public WordPress site it is not unusual, because bots try all the time. What matters is that no attempt succeeds: strong passwords, two-factor login and limited attempts ensure that, and server-level filtering reduces the load.
Can I just switch off xmlrpc.php?
If you do not use the mobile publishing app or plugins that rely on XML-RPC, yes. It is best blocked at server level. Check first whether any of your integrations use it.
Does a CAPTCHA on the login page help?
It helps against simple bots on the login form, but it does not protect XML-RPC and does not replace two-factor login. Use it as an extra layer, not as the only protection.
More articles that might help
Field experience with break-ins, Google warnings and the first steps after a suspicion.

Security HTTP Headers for WordPress: HSTS, CSP and the Rest Explained Without Jargon
A few lines of configuration tell the browser how to protect your visitors. What each security header does, how to check where you stand and...

Is a WordPress Plugin Safe? How to Check It Before Installing and Track Vulnerabilities After
Most WordPress break-ins start in a plugin. How to assess a plugin in five minutes before installing it, what vulnerability severity ratings...

How to Choose Secure WordPress Hosting: 12 Questions to Ask Before You Pay
Price and disk space say the least about how secure a host is. Twelve questions that reveal how a host will behave on the day something goes...
Want to know whether your site is clean?
Run the free check: it takes less than a minute and needs no sign-up.
Run the check