You check your security plugin and see hundreds of failed login attempts from countries you’ve never done business with. Or your host emails you to say your site is using too many resources, and the logs are full of requests to wp-login.php. Nobody is targeting you personally. Your site has simply been found by bots that try to guess WordPress passwords all day, every day.
This is called a WordPress brute force attack, and almost every WordPress site faces one sooner or later. Most of these attempts fail, but the ones that succeed lead straight to a hacked site, and even failed attempts can slow your server to a crawl. In this guide, we explain how these attacks work, how to tell if your site is being targeted, and the practical steps that stop them.
What Is a WordPress Brute Force Attack?
A brute force attack is an automated attempt to guess a username and password by trying many combinations, one after another. On WordPress, bots usually target two places:
wp-login.php: the normal login pagexmlrpc.php: an older remote access feature that accepts usernames and passwords, and can test many passwords in a single request
There are a few common variations:
- Dictionary attacks try common passwords like
123456,passwordor your site name. - Credential stuffing uses real email and password pairs leaked from other websites. If you reuse a password, this is the attack that gets in.
- Distributed attacks spread the attempts across thousands of IP addresses, so each one only tries a few times and avoids simple blocks.
The attackers don’t need your username in advance. WordPress can reveal usernames through author archive URLs and, on many sites, through the REST API users endpoint, and many sites still use admin.
Signs Your Site Is Under Attack
Most site owners only notice a WordPress brute force attack when something goes wrong. These are the signs to watch for:
- Your security plugin reports many failed logins or lockouts, often for usernames like
adminor your domain name - You receive a flood of lockout notification emails
- The site becomes slow, or shows
503or508 Resource Limit Reachederrors - Your host warns you about high CPU usage or temporarily suspends the site
- Access logs show many
POSTrequests towp-login.phporxmlrpc.php
If you have SSH access, you can see which IP addresses are hitting the login page the most. Replace the log path with the one your host uses:
grep "POST /wp-login.php" access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -20
Run the same command with xmlrpc.php in place of wp-login.php to check the other entry point.

Why Brute Force Attacks Are Dangerous
A successful attack gives the attacker your WordPress account. If that account is an administrator, they can install plugins, edit files, add hidden admin users and plant a backdoor. From there, the usual results are spam pages, redirects, phishing pages or a credit card skimmer on a WooCommerce store.
Even when every attempt fails, the attack still costs you. Each login attempt runs PHP and queries your database. On shared hosting, thousands of attempts per hour can use up your resource limits and take the site offline for real visitors.
If you think an attacker already got in, stop here and follow our guide on what to do when your WordPress site is hacked first. Blocking login attempts won’t remove someone who is already inside.
How to Stop a WordPress Brute Force Attack: Step by Step
You can apply most of these steps in under an hour, and none of them require you to be a developer. No single setting stops every attack. The best protection uses several layers, so that if one fails, the next one still holds.
Step 1: Use strong, unique passwords
This is the most important step. Give every account a long, random password that isn’t used anywhere else, and store it in a password manager. A unique password defeats credential stuffing completely, and a long random one makes guessing impractical. Ask every user with an Editor or Administrator role to do the same.
Step 2: Turn on two-factor authentication
WordPress core doesn’t include two-factor authentication, so add it with a well-maintained plugin. With 2FA enabled, a correct password alone isn’t enough to log in. Require it for every administrator account at minimum.
Step 3: Limit login attempts
By default, WordPress lets anyone try to log in as many times as they want. A login limiting or security plugin, such as Limit Login Attempts Reloaded or Wordfence, blocks an IP address after a few failed attempts. Set a short lockout after 3 to 5 failures, and longer lockouts for repeat offenders.
Step 4: Block attacks before they reach WordPress
Plugins only act after the request has reached your server and started PHP. A web application firewall (WAF) at the edge, such as one offered by your CDN or host, can rate-limit or challenge login requests before they touch WordPress. This is the best way to handle large, distributed attacks. Many hosts also offer server-level brute force protection that you can turn on in the control panel.
Step 5: Disable or restrict XML-RPC
If you don’t use the WordPress mobile app, Jetpack or a remote publishing tool, you probably don’t need xmlrpc.php. Blocking it removes an entry point that lets bots test many passwords in one request. On Apache or LiteSpeed, add this to your root .htaccess file:
<Files xmlrpc.php>
Require all denied
</Files>
If you rely on a service that uses XML-RPC, restrict and rate-limit it in your firewall instead of blocking it completely.

Step 6: Add a password to wp-login.php
For sites with only a few users, HTTP authentication adds a second password prompt in front of the login page, so bots never reach WordPress at all. Many control panels have a “Directory Privacy” or “Password Protect” tool. On Apache, you can create a password file with htpasswd -c /home/youruser/.htpasswd yourname, store it outside your web root, and add this to .htaccess:
<Files wp-login.php>
AuthType Basic
AuthName "Restricted"
AuthUserFile /home/youruser/.htpasswd
Require valid-user
</Files>
Skip this on membership sites or WooCommerce stores where customers need to log in.
Step 7: Stop using the admin username
If an account is called admin, create a new administrator with a different name, log in with it, and delete the old account, assigning its content to the new user. With WP-CLI, run wp user create newname you@example.com --role=administrator, then wp user delete 1 --reassign=2, using the correct user IDs from wp user list. Also keep the number of administrator accounts as low as possible.
Step 8: Add a CAPTCHA and keep everything updated
A CAPTCHA or similar challenge on the login page stops many simple bots. And because some plugin vulnerabilities let attackers skip the login entirely, update WordPress, plugins and themes every week.
These steps match the recommendations in the official WordPress brute force attacks handbook.
What About Changing the Login URL?
Plugins that move wp-login.php to a custom address can reduce the noise from simple bots and lower server load. They don’t fix weak passwords, though, and they don’t protect xmlrpc.php. Treat a custom login URL as a small extra layer, not as your main protection.
How to Keep Login Bots Out for Good
Once the attack is under control, a few simple habits keep your login safe over the long term:
- Review your users every few months and remove accounts that are no longer needed
- Check your security plugin’s login logs regularly, not only when something breaks
- Keep your hosting control panel and email accounts protected with 2FA too
- Add security headers as part of your overall hardening; see our guide on fixing missing security headers in WordPress
Our full checklist on how to prevent a WordPress hack covers the rest of the hardening steps.
Frequently Asked Questions
Why is my small website being attacked?
Brute force attacks are automated. Bots scan the internet for any site running WordPress and try the same list of passwords on all of them. The size or popularity of your site doesn’t matter to them.
Can a brute force attack crash my site?
Yes. Every login attempt uses server resources. A large attack can push a shared hosting account over its limits and cause slow pages, 503 errors or a temporary suspension.
Is a security plugin enough?
A plugin helps a lot, especially for limiting attempts and adding 2FA. For heavy or distributed attacks, a firewall at the edge or server level works better, because it blocks traffic before WordPress loads.
How do I know if a WordPress brute force attack succeeded?
Look for administrator accounts you don’t recognize, plugins you didn’t install, changed files, or successful logins from unfamiliar locations in your security plugin logs. If you see any of these, check our list of hacked website signs and treat the site as compromised.
Should I block whole countries?
It can reduce noise if you never have legitimate users from those countries, but distributed attacks use IP addresses from everywhere. Strong passwords, 2FA and rate limiting do far more.
Already Hacked After a WordPress Brute Force Attack?
If an attacker guessed a password and got into your dashboard, blocking logins now won’t remove the accounts, backdoors and malware they left behind. We clean the site, remove every unknown user and backdoor, reset your credentials and lock down your login. Get started with our hacked website repair service, or choose emergency malware removal if your site is under attack right now.






