
Every WordPress site faces constant login attacks. WordPress brute force protection is therefore basic site hygiene, not an optional extra. Bots probe wp-login.php day and night, trying common usernames, leaked credentials from old data breaches, and weak passwords reused across sites. WordPress, by default, allows unlimited login attempts, so without protection an attacker can keep guessing indefinitely. This guide shows you how to protect your WordPress login from brute force attacks in 2026, using free tools that take less than an hour to apply.
What Is a Brute Force Attack on WordPress?
A brute force attack is an automated attempt to log in by guessing username and password combinations, thousands of times if needed. Modern attacks are smarter than old dictionary attacks: they use credential stuffing with passwords leaked from other sites, password spraying (one common password tried against many usernames), and slow, distributed attempts from many IP addresses so simple IP blocks miss them. The usual targets are wp-login.php, xmlrpc.php, and REST API login endpoints. The goal is always the same: one valid admin login, after which the attacker can install malware, redirect visitors, or lock you out.
Step 1: Use a Strong Username and Password
The single most effective defence costs nothing. Never use “admin” as a username โ every bot tries it first. Create a new administrator account with an unusual username, log in as that account, and delete the old “admin” user, attributing its posts to the new account. Then set a long, random password of at least 20 characters, generated by a password manager, and never reuse it anywhere else. A password leaked from another service is the most common way these attacks succeed, because credential stuffing simply replays a password that already works somewhere else.
Step 2: Limit Login Attempts
Limiting login attempts is the non-negotiable baseline of WordPress brute force protection. Install a reputable plugin such as Limit Login Attempts Reloaded, or use the brute force protection built into a security suite like Wordfence. Set a sensible policy: lock an IP out for 15 to 60 minutes after 3 to 5 failed attempts, with longer lockouts for repeat offenders. Prefer IP-based lockouts over account lockouts where your plugin offers the choice, because a strict account lockout can be abused to lock real users out. Whitelist your own office or VPN IP so you never lock yourself out.
Step 3: Enable Two-Factor Authentication (2FA)
Two-factor authentication is the layer that makes a stolen or guessed password useless on its own. With 2FA enabled, logging in requires a second proof of identity โ usually a time-based code from an authenticator app on your phone โ in addition to the password. Enable 2FA for every administrator account at minimum, and ideally for every user who can publish or edit content. Free plugins such as WP 2FA provide this, and most security suites include it too. Store backup codes somewhere safe, away from the site, so a lost phone does not lock you out. If you do only one thing from this guide, make it this one: 2FA defeats credential stuffing entirely, even when the password is already known.

Step 4: Disable XML-RPC and Protect wp-login.php
XML-RPC is a second login door that many sites never use. It lets remote apps post to WordPress, but bots abuse it to test hundreds of passwords in a single request, bypassing normal login limits. If you do not use the WordPress mobile app or a remote publishing tool, disable XML-RPC with a small plugin or a server rule. Next, reduce the noise hitting wp-login.php itself: move the login page to a custom URL with a plugin such as WPS Hide Login, or password-protect wp-login.php at the server level with an extra .htpasswd login via your hosting panel. Neither measure replaces 2FA or login limits, but both cut the volume of attacks reaching WordPress.
Step 5: Add a Firewall and Block Bad Bots
A web application firewall (WAF) stops attacks before they reach WordPress at all. A free Cloudflare plan, or the firewall in a security plugin, can rate-limit requests to wp-login.php and xmlrpc.php and block known-bad IP addresses automatically. Turn on bot-management features if your CDN offers them. Note that CAPTCHA alone is no longer enough: modern solving services crack common CAPTCHAs cheaply, so treat CAPTCHA as one extra layer, not your main defence. A firewall plus login limits plus 2FA is the combination that actually holds up in 2026. For a broader hardening routine, see our guide on how to secure WordPress in 2026.
Step 6: Keep Everything Updated and Watch the Logs
Outdated plugins and themes are the other open door attackers use once login guessing fails. Enable automatic updates for minor WordPress core releases, and update plugins and themes promptly โ most exploited vulnerabilities are already patched by the time attacks start. Delete any plugin or theme you do not actively use, even if deactivated. Finally, check your security logs weekly for repeated failed logins, new admin users, and logins from unfamiliar countries or times. A sudden spike, or any successful login you do not recognise, is a warning to change passwords and scan the site at once. If an attack ever succeeds, reset every password, regenerate the security keys in wp-config.php to log out all sessions, and scan for backdoors.
Conclusion
WordPress brute force protection works best as layers, not a single trick: a unique username and strong password, limited login attempts, two-factor authentication on every admin account, XML-RPC disabled, and a firewall in front of wp-login.php. Apply them in order, test that you can still log in yourself, and keep everything updated. Bots will keep knocking, but with these layers in place they will waste their time and get blocked long before they reach anything sensitive. Explore more help on KamiWeb’s free tools and the KamiWeb blog.
