Right now, as you read this, automated bots are hammering WordPress login pages around the world — trying thousands of username and password combinations per minute, looking for any site with weak credentials they can compromise.
Thousands of login attempts per minute — automated
This is called a brute force attack — and it's the most common attack method used against WordPress sites. It requires no sophistication from the attacker: just automated software, a list of common passwords, and time.
The good news: brute force attacks are among the easiest WordPress threats to defend against. This guide covers every effective method to stop brute force attacks on your WordPress site — from quick plugin-based fixes to server-level protection.
What Is a WordPress Brute Force Attack?
A brute force attack is an automated attempt to gain access to your WordPress admin dashboard by systematically trying large numbers of username and password combinations until one works.
How it works:
- A bot discovers your WordPress login page at
yourdomain.com/wp-login.php
- It systematically tries common combinations:
admin/password, admin/123456, admin/admin, etc.
- It may use credential stuffing — trying username/password pairs leaked from other data breaches
- If it finds a match, it logs in and the attacker gains admin access
Why it's effective against unprotected sites:
- WordPress's default login page is at a known URL
- WordPress allows unlimited login attempts by default
- Many sites still use
admin as the username
- Many users choose weak, common passwords
The consequences of a successful brute force attack:
- Complete admin access to your WordPress site
- Malware installation
- SEO spam injection (hidden links, doorway pages)
- Site defacement
- Customer data theft
- Your server used to attack other sites
01
Limit Login Attempts
The most fundamental brute force defence. By default, WordPress allows unlimited login attempts — making brute force attacks trivially easy. Limiting attempts to 3–5 before locking out an IP address makes automated attacks impractical.
Using Limit Login Attempts Reloaded (Free):
- Go to Plugins → Add New → search "Limit Login Attempts Reloaded"
- Install and activate
- Go to Settings → Limit Login Attempts
- Configure: Allowed retries: 3–4, Minutes lockout: 20, Lockouts increase lockout time by: 4 times, Hours until retries are reset: 24
- Enable email notification on lockout
- Save settings
Using Wordfence (Comprehensive):
- Install and activate Wordfence Security
- Go to Wordfence → Firewall → Brute Force Protection
- Configure: Lock out after 5 login failures, 4 hours lockout time, enable "Immediately lock out invalid usernames", enable "Prevent the use of passwords leaked in data breaches"
Pro Tip: With these settings, after 3 failed attempts, an IP is locked out for 20 minutes. After repeated lockouts, the lockout extends to days — making brute force attacks computationally impractical.
02
Change the WordPress Login URL
Moving your login page from the default /wp-login.php to a custom URL eliminates the vast majority of brute force attempts — bots scanning for WordPress sites won't find your login page at all.
Using WPS Hide Login (Free):
- Install and activate WPS Hide Login
- Go to Settings → General → scroll to bottom
- Find the Login URL field
- Change it to something non-obvious:
/enter-here, /manage, /dashboard-2026
- Save changes
The old /wp-login.php now returns a 404 Not Found error. Bots never find your real login page.
Important: Write down your new login URL immediately. If you forget it and get locked out, you'll need to deactivate the plugin via FTP (rename the plugin folder in /wp-content/plugins/) to restore the default URL.
What to Avoid:
- Don't use obvious alternatives like
/login
- Don't use your company name or domain name
- Avoid patterns that suggest a CMS login:
/cms-login, /admin-login
- A random string or non-obvious phrase works best
03
Enable Two-Factor Authentication
Two-factor authentication (2FA) is the single most effective defence against brute force attacks because it makes stolen credentials worthless. Even if an attacker correctly guesses your password, they still can't log in without the second factor.
Using WP 2FA (Free, by Melapress):
- Install and activate WP 2FA
- Run the setup wizard
- Choose your preferred 2FA method: TOTP authenticator app (Google Authenticator, Authy, 1Password) — most secure, or Email OTP — less secure but easier
- Enforce 2FA for all administrator accounts (minimum)
- Set a grace period for existing users to set up 2FA
For sites with multiple admin users: Enforce 2FA across all high-privilege roles (Administrator, Editor) under WP 2FA → Policies.
04
Add CAPTCHA to the Login Page
CAPTCHA (reCAPTCHA or similar) requires proof of humanity before a login attempt is processed. This effectively blocks automated bots that can't solve visual challenges.
Google reCAPTCHA v3 (Invisible, Best UX):
reCAPTCHA v3 runs silently in the background — it scores user behaviour without showing a challenge. Suspicious scores (indicating bots) are blocked automatically.
- Get a free reCAPTCHA API key from google.com/recaptcha
- Choose reCAPTCHA v3
- Install Login No Captcha reCAPTCHA
- Go to Settings → No Captcha reCAPTCHA
- Enter your site key and secret key
- Enable for login page, registration, and password reset
Pro Tip: Wordfence Pro includes reCAPTCHA integration built in. If your brute force exposure also includes form submission abuse, enable reCAPTCHA in your form plugin settings too.
05
Block XML-RPC
XML-RPC is an alternative WordPress authentication endpoint that many attackers exploit for brute force attacks — it allows multiple authentication attempts per request, making it faster for attackers than targeting /wp-login.php directly.
Unless you specifically use XML-RPC for Jetpack, the WordPress mobile app, or another integration, disable it entirely:
Via .htaccess:
<Files xmlrpc.php>
Order deny,allow
Deny from all
</Files>
Via plugin: Install Disable XML-RPC (free) for a one-click solution.
If you need XML-RPC (for Jetpack): Configure Wordfence or your security plugin to block XML-RPC multiple authentication attempts while allowing legitimate single requests.
06
IP Blocking and Geolocation Restrictions
If your site serves a specific geographic market and you're seeing brute force attacks from certain countries, blocking those countries at the firewall level can significantly reduce attack volume.
Cloudflare Geolocation Blocking (Free):
- Log in to your Cloudflare dashboard
- Go to Security → WAF → Custom Rules
- Create a rule: Field: Country, Operator: is not in, Value: [your target countries], Action: Block
- Deploy the rule
Manual IP Blocking via .htaccess:
<RequireAll>
Require all granted
Require not ip 123.456.789.0
Require not ip 98.76.54.0/24
</RequireAll>
For ongoing IP blocking management, use IP Geo Block (free plugin) which integrates country-level blocking with WordPress-specific rules.
07
Use a Web Application Firewall (WAF)
A WAF sits between your WordPress site and incoming traffic, analysing requests and blocking those that match known attack patterns — including brute force patterns — before they reach WordPress.
- Cloudflare WAF (Free + Pro): Cloudflare's free plan includes basic WAF protection. The Pro plan ($20/month) adds the full managed ruleset including WordPress-specific rules that block login page abuse.
- Wordfence Firewall: Wordfence's built-in firewall operates at the PHP level — it intercepts requests before WordPress processes them. The free version includes a solid ruleset; premium gets real-time rule updates.
- Sucuri Website Firewall (Premium): Sucuri's cloud-based WAF is one of the best available — it stops brute force attacks, DDoS, SQLi, XSS, and more at the network edge before anything reaches your server.
08
Harden wp-config.php and WordPress Security Keys
WordPress uses secret keys and salts in wp-config.php to secure authentication cookies. Using strong, unique keys makes session hijacking (a related attack vector) far harder.
Generate fresh security keys:
- Visit api.wordpress.org/secret-key/1.1/salt/
- Copy the generated keys
- Open
wp-config.php via FTP
- Find the existing
define('AUTH_KEY', ...) section
- Replace all 8 key definitions with your new ones
- Save the file — all existing sessions will be invalidated (all users will need to log in again)
Pro Tip: This is especially important after a suspected compromise — regenerating keys immediately invalidates any attacker sessions.
09
Monitor and Respond to Attacks
Set up monitoring so you know when attacks are happening and can respond quickly:
Enable Wordfence email alerts:
Go to Wordfence → Email Alert Preferences and enable: Alert when someone is locked out from logging in, Alert on critical problems, Weekly security summary.
Check your server access logs regularly:
Repeated POST requests to /wp-login.php or /xmlrpc.php from the same IP are a clear sign of brute force activity. Most hosting providers show access logs in cPanel under Logs.
Set up UptimeRobot:
A sudden site outage can be caused by a successful compromise or a brute force attack overwhelming your server. UptimeRobot (free) alerts you within minutes.
Brute Force Defence Stack Recommendation
For most WordPress sites, this combination provides excellent protection with minimal effort:
Minimum protection (free, 30 minutes setup):
- Limit Login Attempts Reloaded
- WPS Hide Login (change login URL)
- Strong password + change admin username
- Disable XML-RPC
Strong protection (free, 1 hour setup):
- Wordfence Security (replaces Limit Login Attempts)
- WPS Hide Login
- WP 2FA (two-factor authentication)
- Cloudflare free (CDN + basic WAF)
- Disable XML-RPC
Maximum protection (recommended for business/eCommerce sites):
- Wordfence Premium (real-time threat intelligence)
- Custom login URL
- 2FA enforced for all admin users
- Cloudflare Pro (full WAF ruleset)
- Sucuri or Cloudflare WAF
- Regular security audits
Frequently Asked Questions
Q: My server logs show thousands of failed login attempts. Has my site been compromised?
A: Failed login attempts mean attacks are happening — not necessarily that they've succeeded. Check your WordPress admin for unfamiliar users, check Wordfence's scan results for malware, and verify your wp-admin access works normally. Then implement the defences in this guide to stop the attacks going forward.
Q: Will limiting login attempts lock out legitimate users?
A: Occasionally — if a legitimate user forgets their password and tries repeatedly. Configure your security plugin to email you lockout notifications so you can whitelist legitimate users. You can also whitelist your own IP address so you're never locked out.
Q: Is a hidden login URL enough on its own?
A: It significantly reduces automated attacks, but shouldn't be your only defence. A targeted attacker can discover your login URL by scanning for it or finding it in your HTML source. Use it as one layer of a multi-layered defence.
Q: XML-RPC is disabled but I'm still seeing attacks on it. Why?
A: Bots scan for XML-RPC before checking if it's enabled. The requests will continue in your logs even after disabling — but they'll return 403 errors rather than reaching WordPress. This is normal and expected.
Final Thoughts
Brute force attacks are persistent, automated, and inevitable on any public-facing WordPress site. The defences in this guide don't just reduce risk — they make your site effectively impenetrable to automated brute force attacks.
Implement at minimum the first four layers: limit login attempts, change your login URL, enable 2FA, and disable XML-RPC. These four measures stop over 99% of automated brute force attacks.
Need help implementing a complete brute force defence stack on your WordPress site? Our security team handles exactly this.
Contact us today