Open the login logs of almost any public website and you'll find the same thing: a steady stream of failed login attempts from addresses all over the world, trying usernames like "admin" and passwords like "123456." This is a brute-force attack, and it's happening to sites of every size, all the time.
The good news is that brute-force attacks are among the easiest threats to defend against. This guide explains how they work and the practical steps that stop them.
What is a brute-force attack?
A brute-force attack is an attempt to get into an account by guessing credentials over and over until one works. Variations include:
- Simple brute force: trying many password combinations against one username.
- Dictionary attacks: trying lists of common passwords and words.
- Credential stuffing: using username and password pairs leaked from other websites' data breaches, betting that people reuse passwords.
- Password spraying: trying a few common passwords across many accounts to avoid lockouts.
- Distributed attacks: spreading attempts across many IP addresses, often from botnets, so each address only tries a few times.
The targets are any login form: your CMS admin, your hosting control panel, email accounts, FTP and SSH.
Why it matters even if your passwords are strong
Even if no guess ever succeeds, brute-force traffic has costs:
- It uses server resources. Every login attempt on a PHP application like WordPress runs code and database queries. Heavy attacks can slow your site or push you against your hosting resource limits.
- It can lock out legitimate users if lockout rules are too aggressive.
- One weak account is enough. A forgotten editor account with an old password can be the way in.
Layer 1: Strong, unique passwords
This is the foundation. A long, random password that's unique to your site makes guessing practically impossible, and uniqueness defeats credential stuffing.
- Use a password manager to generate and store passwords.
- Require strong passwords for every account with admin or editor access.
- Remove accounts that are no longer needed.
Our guide to strong passwords and two-factor authentication goes deeper.
Layer 2: Two-factor authentication (2FA)
With 2FA, a correct password isn't enough on its own. The attacker would also need a code from the user's authenticator app or a physical security key. Turn on 2FA for:
- Your CMS admin accounts
- Your hosting control panel
- Your domain registrar
- Your email accounts
If you only do one thing from this article beyond strong passwords, make it this.
Layer 3: Limit login attempts
Limiting failed attempts slows attackers down dramatically. Common approaches:
- Temporary lockouts after a set number of failures, for example locking an IP out for a period after several failed tries.
- Progressive delays that increase the wait after each failure.
- Account-level throttling, which helps against distributed attacks that rotate IPs.
For WordPress, many security plugins include login limiting. On a VPS, tools such as Fail2ban watch log files and temporarily block IPs that show repeated failures. Many hosting servers also run automated brute-force detection for control panel and email logins.
Be careful not to set thresholds so low that you lock out your own team after one typo.
Layer 4: Don't use predictable usernames
Attackers almost always try "admin," "administrator," the site name and the domain name first. Use a non-obvious username for administrator accounts.
On WordPress, also consider that author archive URLs and the REST API can reveal usernames. Some security plugins can limit that exposure. Using a separate display name from your login username helps too.
Layer 5: Add a CAPTCHA or challenge
A CAPTCHA or invisible bot challenge on your login page stops many automated scripts. Modern options like Google reCAPTCHA, hCaptcha and Cloudflare Turnstile can run with little or no friction for real users. Our guide to stopping spam with CAPTCHA covers how these compare.
Layer 6: Protect WordPress-specific entry points
WordPress sites have a couple of well-known targets:
wp-login.php
This is the standard login page. Options to harden it include:
- Rate limiting and lockouts via a security plugin
- Adding HTTP authentication (a second username and password prompt) to the
wp-adminarea or login page via your control panel's directory privacy feature - Restricting access by IP address if your team works from fixed locations
- Changing the login URL with a plugin. This reduces noise from bots but isn't real security on its own
xmlrpc.php
XML-RPC is an older remote-access interface. Attackers have abused it to try many passwords in a single request. If you don't use apps or services that need it (some mobile apps and older integrations do), you can disable it with a security plugin or a server rule. Test that anything relying on it still works afterward.
Layer 7: Use a firewall
A web application firewall can block known malicious IPs, rate-limit login endpoints and challenge suspicious traffic before it reaches your application. Cloud-based firewalls are especially effective against large distributed attacks because the traffic never reaches your server.
Protecting other logins on your hosting account
Brute-force attacks don't only target your website:
- Control panel: use a strong password and enable 2FA in your cPanel or DirectAdmin security settings.
- Email accounts: every mailbox needs a strong password. A compromised mailbox can be used to send spam and damage your domain's reputation, as explained in why emails go to spam.
- FTP: prefer SFTP or FTPS, delete unused FTP accounts, and limit each account to the folder it needs.
- SSH (on a VPS): use key-based authentication, disable password logins, and consider disabling direct root login. See first steps on a new Linux VPS.
How to tell if you're being targeted
- Security plugin logs showing repeated failed logins
- Access logs (available in most control panels) with many POST requests to
wp-login.phporxmlrpc.php - Sudden CPU spikes with no matching rise in real visitors
- Lockout notification emails
Some background noise is normal. Look for sudden increases or attempts on real usernames.
Wrapping up
Brute-force attacks are constant, automated and mostly unsophisticated, which is why basic defenses work so well. Use strong, unique passwords and 2FA, limit login attempts, avoid obvious usernames, add a bot challenge, harden WordPress entry points and put a firewall in front. Apply the same care to your control panel, email, FTP and SSH logins, and brute-force attempts become little more than noise in your logs.