Docs

I locked myself out

7 min readUpdated November 19, 2026

Nahnu Login Shield is built to stop strangers, and sometimes that includes you. This topic gets you back in, starting with the quickest fix. Find the message you’re seeing, then follow the steps.

Find your situation#

What you seeMost likely causeGo to
“Too many failed attempts” or a lockout message with a countdownLockout after wrong passwordsFix 1, 2 or 3
“Login not available in your region”Geo-blockingFix 3
A plain 403 or 429 page from your server, or a blank “too many requests” page, before the login form appearsLockout, early-block rate limit, blocklist, or an edge ruleFix 1, 2, 3 or 7
The login form accepts your password, then asks for a code you can’t produceTwo-factor authenticationFix 4
/wp-login.php shows a 404 pageCustom login URL, and you forgot the new addressFix 5
“Security check expired” or the CAPTCHA never completesNot a lockout: a cached login page or a provider problemSee Caching and login pages and What happens if a provider goes down
The lockout hits many people at onceA proxy or CDN hides the real IPSee Lockouts are keyed to the wrong IP

Fix 1: Wait#

Lockouts end by themselves. The length is whatever you set under Lockout (and it grows if you use escalating lockouts). If you only mistyped a password a few times, waiting is the safest option. The early-block rate limit (20 login requests a minute from one IP) clears within a minute if you stop. An IP that keeps hitting it gets a normal lockout.

Attempts while you are locked out are not counted. Failures after it ends start a new lockout, and after 4 lockouts in a week the lockout lasts 24 hours (defaults).

Fix 2: Get in from another IP address#

Lockouts are per IP address (and optionally per username), so a different connection works straight away.

  1. Switch to a different network, such as your phone’s mobile data or a VPN.
  2. Sign in there.
  3. Open Settings → Login Shield → Lockout and find your normal IP in the list of locked IPs. Click Unlock. See Unlock an IP.
  4. If you were on the blocklist, remove your IP from Blocked IPs on the Lockout tab.
  5. Add your home or office IP to the whitelist on the Lockout tab so it can’t happen again.

If you have no other network, use Fix 3.

Fix 3: Add your IP to the emergency bypass (wp-config.php)#

This works even when you can’t reach the login page at all. It needs access to your site’s files (FTP/SFTP, your host’s file manager, or SSH).

  1. Find your public IP address. Search “what is my IP” in your browser from the network you’re locked out on.
  2. Open wp-config.php, in the main WordPress folder.
  3. Add this line above the text /* That's all, stop editing! */:
define( 'NAHNLS_BYPASS_IP', '203.0.113.25' );

Replace the address with yours. You can list several addresses and CIDR ranges, separated by commas:

define( 'NAHNLS_BYPASS_IP', '203.0.113.25, 198.51.100.0/24, 2001:db8::/32' );
  1. Save the file and reload the login page.

What the bypass covers: lockouts, the IP blocklist, geo-blocking, and the early-block rate limit.

What it doesn’t cover: two-factor authentication (use Fix 4) and role-based IP rules (use Fix 6). Edge blocks at Bunny.net or Cloudflare happen before WordPress runs (use Fix 7).

The old constant name NLS_BYPASS_IP still works, but use the new one.

  1. When you’re back in, add your IP to the whitelist in the dashboard. You can then remove the line from wp-config.php, or keep it as a permanent safety net. If you keep it, update it if your IP changes.

Is your IP the real one? If your site is behind a proxy or CDN, your server may see the proxy’s IP, not yours. The bypass then matches the wrong address. See Lockouts are keyed to the wrong IP.

Fix 4: You can’t pass two-factor authentication#

You lost your phone, the authenticator app shows codes that are rejected, or the email code never arrives.

First, try the alternatives on the sign-in screen:

  • A backup code, if you saved them.
  • An email code (always available), if your site can send mail.
  • A passkey, if you added one.

If none of those work, switch 2FA off from wp-config.php. This needs file access:

  1. Open wp-config.php.
  2. Add, above the “stop editing” line:
define( 'NAHNLS_DISABLE_2FA', true );
  1. Save and sign in with your username and password only. Nobody on the site is asked for a second factor while this line is present. Nahnu Login Shield shows a warning on its own settings page while it is on.
  2. Go to Users → Login & security (or Profile → Login & security if you can’t list users) and set up your authenticator again, with new backup codes.
  3. Remove the line from wp-config.php. The Checklist also flags it until you do.

An administrator with a second account can also reset another user’s 2FA. See Set up an authenticator app.

Fix 5: You can’t find the login page (custom login URL)#

If you changed the login address on the General tab, /wp-login.php and /wp-admin/ no longer show the login form for visitors who aren’t signed in. If you forgot the new address:

  • Check your bookmarks and browser history for the address you set.
  • Check with whoever set it up. They may have recorded it.
  • If you still can’t find it, turn Nahnu Login Shield off (Fix 6). The old address works again. If you installed the early-block file, delete it too, as described in Fix 6.

After you’re back in, open General → Custom login URL and write the address down in your password manager.

Fix 6: Turn the plugin off completely#

This works for every kind of lockout, including role IP rules, a bad custom login URL and settings that you can’t undo. It needs file access.

  1. Connect by FTP/SFTP, your host’s file manager, or SSH.
  2. Go to wp-content/plugins/.
  3. Rename the folder nahnu-login-shield to nahnu-login-shield-off.
  4. Reload the site and sign in as usual. WordPress deactivates a plugin whose folder has gone missing.
  5. Check the early-block file. If you turned on the early-block option, there is a separate file at wp-content/mu-plugins/nahnls-early-block.php. Delete that file as well. It keeps running after the plugin folder is renamed, and with a custom login URL it keeps answering /wp-login.php with a 404 or a redirect to the home page, as well as showing the 403 and 429 pages.
  6. Rename the plugin folder back to nahnu-login-shield and activate the plugin from Plugins. Then fix the setting that locked you out.

Renaming doesn’t delete your settings. They stay in the database.

If you have no file access, ask your host’s support to rename the folder.

Fix 7: You’re blocked at the edge (Bunny.net or Cloudflare)#

If you use Edge Blocking, Nahnu Login Shield can add block rules at Bunny.net or Cloudflare. These rules run before your site loads, so the wp-config.php bypass can’t help.

  1. Sign in to your Bunny.net or Cloudflare dashboard.
  2. Find the rule or access-list entry that blocks your IP, and delete it. In Bunny it is on the Shield access list “Nahnu Login Shield lockouts”, or the pull zone’s blocked IP list. In Cloudflare it is under IP Access Rules.
  3. Reload your site.
  4. Back in the plugin, open the Edge Blocking tab and check the edge block log to see what was blocked.

Unblock removes the block at Cloudflare and on the Bunny Shield access list. Unlocking the IP on the Lockout tab does the same. Only blocks on the plain Bunny pull-zone list are left to expire at Bunny. If you can’t reach wp-admin, delete the block in the CDN dashboard.

After you’re back in#

  1. Whitelist your IP on the Lockout tab (home and office). Whitelisted IPs are never locked out.
  2. Save your backup codes in a password manager.
  3. Don’t test your own lockout from your real IP. Test from a phone connection, or whitelist your IP first and temporarily remove it.
  4. Check your IP detection. If the plugin sees the wrong IP (for example, your CDN’s), a lockout can hit many people at once. See Lockouts are keyed to the wrong IP (proxies and CDNs).
  5. Run the Checklist. It flags leftover emergency settings such as NAHNLS_DISABLE_2FA.

Was this helpful?

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only