WordPress Plugins
Free Tools
Pricing Blog Case Studies Switch to Royal Plugin Graveyard Support My Account Cart
Support / GuardPress / Brute-Force Protection Setup

Brute-Force Protection: Setup, Tuning, and Locked-Out IP Recovery

GuardPress Brute-Force Protection watches every failed login (wp-login.php, WooCommerce my-account, MemberPress, theme login forms, REST API Application Passwords) and temporarily blocks any IP that hits your configured max attempts. Repeat offenders escalate to a permanent ban. This walkthrough covers each setting, what happens on the 5th failed login, how to unblock a legitimate user who got caught in the lockout, and how to whitelist your own office IP so you can never lock yourself out.

A legitimate user is locked out right now? Skip ahead

If an admin, editor, or customer has hit the lockout and you need to let them back in immediately, jump to Unlocking a legit IP from wp-admin. Two clicks on GuardPress → IP Management and they’re back in.

What Brute-Force Protection Actually Does

The module hooks the WordPress authenticate filter at priority 30 and the wp_login_failed + application_password_failed_authentication actions. Every failed sign-in from every surface — wp-login.php, WooCommerce /my-account/, MemberPress, BuddyPress, theme login forms, and REST API Application Passwords — feeds the same per-IP counter. That’s important: an attacker who tries wp-login.php three times then switches to the REST API doesn’t get a fresh counter.

The block flow, with default settings (max attempts 5, lockout duration 15 minutes, permanent ban threshold 3):

Two supplementary counters run alongside this:

The Four Settings You Can Tune

All four live at GuardPress → Settings → Login Protection. The Recommended label on the top toggle is intentional — leaving brute-force protection disabled is one of the fastest ways to get a site compromised.

Enable Brute-Force Protection

Option name: guardpress_brute_force_enabled. Master on / off toggle. When disabled, no failed logins are counted, no IPs are blocked, and the per-IP and per-username counters both go dormant. Existing entries in gp_failed_logins and gp_ip_blocklist are not deleted — if you re-enable the feature later, previously blocked IPs stay blocked until they expire or you unblock them manually.

Max Login Attempts

Option name: guardpress_brute_force_max_attempts. Default: 5. Range: 1–20. The number of failed attempts allowed within the lockout window before the IP is blocked. Lowering this to 3 or 4 makes the site more paranoid; raising it to 10+ is only appropriate if you have a lot of forgetful users and are okay accepting more brute-force surface.

Setting max attempts to 1 or 2 will lock out real users

Anyone who mistypes their password once and immediately corrects it is fine at 3+. At 2 you’ll get support tickets from users who typed their old password from muscle memory once, then their current password. Don’t go below 3 unless you have a specific attack pattern that demands it.

Lockout Duration

Option name: guardpress_brute_force_lockout_duration. Default: 900 seconds (15 minutes). Range: 60–86400 (1 minute to 24 hours). How long a temporarily-blocked IP stays blocked before it can try again. This is also the window used to count failed attempts — failures older than the lockout duration don’t count toward the threshold.

Longer lockouts (1–4 hours) put more friction on real users who genuinely mistyped and got caught; shorter lockouts (5–15 minutes) are kinder to real users but let a patient attacker resume sooner. 15 minutes is the balance most sites want.

Permanent Ban Threshold

Option name: guardpress_permanent_ban_threshold. Default: 3. Range: 0–50. When an IP is about to be locked out and its cumulative lockout count reaches this number (including the block being applied right now), the block escalates to permanent instead of temporary. With the default of 3, that means: 1st lockout temporary, 2nd temporary, 3rd permanent. Set to 0 to disable permanent bans entirely (everything stays temporary and auto-expires).

Permanent bans only apply to IPs that have already demonstrated persistent attack behaviour — a real user who mistypes once and gets one 15-minute lockout is nowhere near this threshold. Attackers doing rotating credential stuffing hit it quickly.

Unlocking a Legit IP from wp-admin

Sometimes a real user (or you) gets caught in the lockout — forgot the password, typed it wrong five times, now their IP is blocked for 15 minutes. If you have wp-admin access from a different IP or an existing session:

Go to GuardPress → IP Management

Scroll to the Active Lockouts & Permanent Bans table. Every currently-blocked IP is listed with its status (Temporary or Permanent), lockout count, the reason string, the timestamp of the block, and the expiry.

Find the affected IP and click Unblock

The row disappears immediately. That IP can now attempt to sign in again on the next request — no page refresh required for the client.

Optionally, whitelist the IP so it can’t happen again

If this was your own IP or a trusted admin’s, add it to the IP Whitelist at the top of the same page. Whitelisted IPs bypass every firewall check — brute-force counter, rate limiting, geographic blocking, everything.

Whitelist your office and home IPs on day one

The single best "I can never lock myself out" hedge is to whitelist your work IP and home IP right after you activate the plugin. Click Whitelist My IP at the top of the IP Management page from each network you regularly sign in from. This costs nothing and eliminates the "I typed the password wrong 5 times, now I’m locked out" scenario forever.

Locked Out with No Admin Session? Change Your IP

If your only IP is blocked and you have no existing wp-admin session anywhere else, brute-force protection doesn’t ship a wp-config bypass constant — there’s no GUARDPRESS_BRUTE_FORCE_BYPASS. The intentional recovery paths, in decreasing order of convenience:

No IP-based bypass constant exists — on purpose

Unlike Emergency Lockdown’s GUARDPRESS_EMERGENCY_BYPASS (which the admin sets deliberately during an incident), a "brute-force bypass" constant would be a permanent backdoor. An attacker who compromised any file on the server could set it, and every brute-force attempt would go through unblocked. Recovery is intentionally through wp-admin (unblock button) or the database (DELETE row) — both require credentials or filesystem access an attacker doesn’t already have.

What the Alert Email Contains

When an IP hits the lockout, GuardPress sends one HTML-formatted email to the address configured in GuardPress → Settings → Email Alerts (or falls back to the WordPress admin_email if that’s empty). Subject line: “[Your Site] Security Alert: IP Address Blocked.” The body includes:

Since 1.6.40 this is the only email you get per attacker within the throttle window. Prior versions sent a “Multiple Failed Login Attempts Detected” warning on attempt 4 then this block email on attempt 5 — two emails per attacker, plus the warning misreported the count as one attempt ahead of reality. That was noise; 1.6.40 dropped the warning and folded the attempt count into this email’s reason string so no information is lost.

A separate throttle (default 1 hour per IP + alert type) suppresses duplicate block emails if the same attacker keeps probing after their block expires and re-triggers. When the throttle window closes, you get one summary email like “Repeat attacker summary: IP 203.0.113.42 triggered 47 ip_blocked events over 58 minutes.” Configure that at Settings → Email Alerts → Alert Throttling. Full details in Quieting GuardPress Security Alert Emails.

Common Mistakes

Setting max attempts to 1 or 2 "for extra security"

You’ll spend more time unlocking your own users than you save in defence. Real users mistype and correct; attackers script and don’t care. Keep max attempts at 3–5.

Turning off permanent bans without a plan

Setting Permanent Ban Threshold to 0 means every block auto-expires no matter how many times an IP re-offends. That’s fine if you review the audit log daily and manually blacklist repeat offenders. If you don’t, the same attacker will hammer you for weeks. Keep the default of 3 unless you have a specific reason.

Forgetting to whitelist office / home IPs

The first time you mistype your own password five times, you’ll wish you had. Whitelist your regular IPs the day you install the plugin — the "Whitelist My IP" shortcut on the IP Management page does it in one click.

Blocking Cloudflare edge IPs instead of your real visitors

If your site is behind Cloudflare and GuardPress can’t see the real visitor IP, every failed login looks like it’s coming from a Cloudflare edge IP — and the block will end up hitting Cloudflare’s IP instead of the attacker’s. Fixed automatically in 1.6.30+ (auto-detects Cloudflare, honours CF-Connecting-IP). If you’re on an older version, upgrade. If you’re on 1.6.30+ and still seeing this, check the diagnostic in Country Blocking and the Cloudflare Real-IP Gotcha.

Confusing brute-force lockouts with manual blacklist entries

The Active Lockouts & Permanent Bans table shows entries created automatically by the brute-force counter. The IP Blacklist table shows entries you added manually. They’re independent lists — removing an IP from Active Lockouts doesn’t remove it from the manual Blacklist and vice versa. See IP Blocking, Whitelisting, and Managing Locked-Out IPs for the full breakdown.

Still Stuck? Email Priority Support

If brute-force protection is misbehaving in a way that isn’t covered above — legit users getting locked out with no obvious cause, blocked IPs that won’t unblock, permanent bans firing on the wrong threshold:

Email support@royalplugins.com with the diagnostic info below. Priority email support is included with your GuardPress Pro license — typical response time is within 24 hours.

Information to include in your email

  • GuardPress version from WP Admin → Plugins
  • WordPress version from WP Admin → Updates
  • The four settings from GuardPress → Settings → Login Protection: max attempts, lockout duration, permanent ban threshold, and whether Enable Brute-Force Protection is on
  • The exact error message the affected user sees in their login form
  • The blocked IP’s row from IP Management — status (temporary / permanent), lockout count, reason string, blocked-at and expires-at timestamps
  • Whether the site is behind Cloudflare or another CDN, and if so, whether GuardPress 1.6.30+ has correctly identified visitor IPs on other pages (check the Your Current IP Address box at the top of the IP Management page — if it shows the CDN’s IP instead of yours, real-IP restoration isn’t working)
  • Recent ip_blocked_brute_force entries from GuardPress → Audit Log
Related GuardPress topics

If the lockout isn’t brute-force: