Preventing Brute Force Attacks on Your Website Login
Preventing Brute Force Attacks
Security Note: This article discusses website security concepts for educational purposes. Always consult a qualified security professional before implementing security changes on production systems.
Brute force attacks attempt to guess your login credentials by trying thousands of username and password combinations automatically. WordPress login pages are prime targets because their URL is predictable (wp-login.php) and there is no built-in rate limiting. Without protection, a persistent attacker will eventually guess weak credentials.
What You Need to Know
Implement login attempt limiting using a security plugin like Wordfence or Limit Login Attempts Reloaded. After 3-5 failed attempts, block the IP address for increasing durations. Change the default login URL from /wp-login.php to a custom URL using a plugin like WPS Hide Login. Use strong, unique passwords and enable two-factor authentication. Cloudflare Bot Protection and rate limiting add an additional layer before traffic even reaches your server.
Understanding Brute Force Attack Scale
A single attacker using basic tools can attempt 100-1000 passwords per second against an unprotected WordPress login page. Botnets amplify this by distributing attempts across thousands of IP addresses, each trying a few passwords — making IP-based blocking less effective alone. WordPress XML-RPC amplifies the problem further by accepting multiple login attempts in a single request through the system.multicall method.
Implementing Multi-Layer Protection
Layer 1: Change the login URL. Install WPS Hide Login and set a custom login path like /my-secret-login. This immediately eliminates 99 percent of automated attacks that target the default wp-login.php URL. Bookmark your new URL and share it only with authorized users.
Layer 2: Rate limiting. Configure your security plugin to block IP addresses after 3-5 failed login attempts. Set lockout duration to escalate: 15 minutes after the first lockout, 1 hour after the second, 24 hours after the third. Wordfence and Limit Login Attempts Reloaded both handle this effectively.
Layer 3: Disable XML-RPC unless you specifically use it for mobile app access or Jetpack features. Add a deny rule in your .htaccess file or use a security plugin to block XML-RPC requests. This closes an alternative login vector that bypasses standard login page protections.
Layer 4: Network-level protection. Cloudflare Bot Fight Mode identifies and blocks automated traffic before it reaches your server. Cloudflare rate limiting rules add another layer by restricting the number of requests to your login URL per IP address.
Monitoring Brute Force Attempts
Review your security plugin logs weekly to understand attack patterns. Persistent attacks from specific IP ranges or countries may warrant geographic blocking. If you see attempts using your actual username, change it immediately — the attacker has obtained it from a breach or enumeration.
Country-Level Blocking for Login Protection
If your website administrators and editors are all located in specific countries, geographic restrictions on the login page provide an additional protection layer. Cloudflare firewall rules can block access to your login URL for traffic originating from countries where you have no team members, eliminating brute force attempts from those regions entirely.
Configure geographic blocking through Cloudflare by creating a firewall rule that targets your login page URL (or your custom login path after changing it with WPS Hide Login) and challenges or blocks traffic from countries outside your whitelist. This approach works well in combination with rate limiting rather than as a replacement for it, since sophisticated attackers may use VPN endpoints in your whitelisted countries.
Wordfence premium includes country blocking as a built-in feature that you can apply to login pages, the rest of the site, or both. The free version does not include this feature, but Cloudflare’s free tier does, making it accessible regardless of your Wordfence subscription level.
Measuring the Impact of Your Brute Force Protection
After implementing login protection measures, quantify their effectiveness by monitoring your security plugin dashboards. Wordfence displays the number of blocked login attempts, blocked IP addresses, and attack types on its dashboard. Compare these numbers month over month to understand your attack exposure.
A typical unprotected WordPress site receives 1,000-10,000 brute force login attempts per month from automated scanning botnets. After implementing the layered protection described above, the number of attempts reaching your actual login page should drop by 95-99 percent, with the remaining attempts blocked by rate limiting and 2FA requirements before authentication succeeds.
If your blocked attempt numbers suddenly spike by an order of magnitude, this indicates a targeted attack against your specific site rather than routine automated scanning. During targeted attacks, consider temporarily enabling Cloudflare Under Attack Mode, adding additional IP blocks for the attacking ranges, and ensuring your admin credentials are strong enough to withstand the increased attention.
Document your brute force protection configuration so that any team member can verify and adjust settings during your absence. Include which plugins handle each protection layer, the specific configuration values (attempt limits, lockout durations, blocked countries), and the escalation procedure for persistent attacks that bypass automated protections.
This content is for informational purposes only and reflects independently researched guidance. Platform features and pricing change frequently — verify current details with providers.