Skip to main content

Stop Bots Hammering Your WordPress Login Page

Bots constantly try to guess your WordPress admin password, wasting server resources and increasing risk. Learn how Cloudflare can protect your login.

Imagine someone standing at your front door, trying every key on a huge ring, 24 hours a day. That’s essentially what’s happening to your WordPress site’s login page right now. Bots from all over the world are constantly trying to guess your admin password, a process known as a brute-force attack.

It’s not just an annoyance; it’s a drain on your server’s resources and a significant security risk. Every failed login attempt still uses up server processing power. If enough bots hit your site at once, it could slow down for legitimate visitors or even go offline. More importantly, every single attempt is a chance, however small, that they might actually guess it.

Cloudflare to the Rescue

One of the most effective ways to stop these constant attacks is by putting a service like Cloudflare in front of your WordPress site. Think of Cloudflare as a bouncer for your website. Before any request even reaches your server, Cloudflare checks it. If it looks suspicious, it gets blocked or challenged.

I’ve been using Cloudflare for years on all my client sites, from small business brochure sites to large e-commerce platforms. It’s an essential part of my security hardening process. I remember one client site that was particularly targeted. Their server logs were full of thousands of failed login attempts every hour. After enabling Cloudflare and setting up some specific rules, that noise dropped to almost zero. It significantly reduced their server load and, more importantly, took the target off their back.

Easy Cloudflare Fixes You Can Implement Today

“I’m Under Attack Mode”

If you have Cloudflare already, you can enable “I’m Under Attack Mode” with a single click. You’ll find this in the ‘Firewall’ section of your Cloudflare dashboard. When activated, Cloudflare will present a JavaScript challenge to every visitor before they can access your site. This is great for stopping automated bots immediately, though it might add a tiny delay for legitimate users.

Custom Firewall Rules

For a more precise approach, Cloudflare Firewall Rules let you block or challenge traffic specifically targeting your wp-login.php page. This means regular visitors won’t see extra challenges, but bots trying to log in will. Here’s how you might set one up:

  1. Log into your Cloudflare account.
  2. Go to ‘Security’ then ‘WAF’ (Web Application Firewall) and click ‘Firewall rules’.
  3. Create a new rule.
  4. You could configure a rule that says: If the URL path contains /wp-login.php AND the Threat Score is greater than 0, then ‘Block’ or ‘Managed Challenge’ the request.

The ‘Managed Challenge’ is often a good starting point. It uses various techniques like CAPTCHAs or silent background checks to verify if the visitor is human. Bots usually can’t pass these.

What About Two-Factor Authentication?

While Cloudflare stops bots from even reaching your login page, two-factor authentication (2FA) is another crucial layer of defense. With 2FA, even if a bot or a person guesses your password, they still need a second piece of information – like a code from your phone – to get in. I highly recommend implementing 2FA for all admin users on your site. This complements Cloudflare’s protection perfectly.

My Recommendation

For clients, I always put Cloudflare in front of their sites. It’s not just for brute-force protection; it also speeds up their sites, protects against other types of attacks, and helps with uptime. If you don’t have Cloudflare set up, it’s one of the first things I’d recommend looking into. It’s a powerful tool that significantly hardens your WordPress security without needing complex server configurations.

If you’re unsure where to start or want to ensure your site is as secure as possible, I offer a free website audit. It checks your speed, core security, SEO basics, and AI search readiness. You’ll get a plain-English report showing what to fix first. Just visit chrisalberto.me/contact/?interest=audit to request yours. My own site scores 100 on all six cards of that audit and 98–100 on Lighthouse mobile, so I know a thing or two about making sites fast and secure.