Skip to content
Witen

WordPress recovery

Recover WordPress login access

Find the control that blocked your login and follow its fix. Keep SFTP or hosting-panel access as a way back in before you change login protection.

A login ban

Stop retrying and wait for the ban to expire. By default, five failed attempts within five minutes earn a one-hour IP ban; your site may use different limits.

From Witen Blocker 0.6.56, a second limit catches slow guessing: 20 failed sign-ins from one address within an hour lock it out for a day. Failed XML-RPC and application-password sign-ins count toward both limits. IPv6 is counted and locked out per /64 network. A lockout can affect other visitors who share that prefix.

Signing in clears only the failures against your own account. It never clears another account’s failures, and it never lifts a lockout. When several people behind one office address trip the limit together, add that address to the Never-block list.

If another administrator can sign in, ask them to review your address under Witen → Firewall → IP Blocklist and add your trusted address under Witen → Firewall → Never-block list. If every visitor shows the same IP, fix your proxy’s client-address setup before you lift the block.

From 0.6.56, Witen → Firewall also lists the lockouts your site is holding, each with a Lift link. Without Warden, Unblock ends an address’s sign-in lockout as well.

Changing login limits does not remove an existing ban.

If the address is marked Held by Warden, the ban lives in the server firewall and nothing in WordPress can lift it. Follow A Warden firewall block instead.

A visitor who reaches you through a CDN or your own trusted proxy is the exception. The firewall only ever sees the CDN’s address, so from 0.6.56 your site holds that lockout itself, even with Warden on the server. Lift it with the Lift link under Witen → Firewall. With Warden 0.1.48 or later on the server, sudo warden unban ends it too, within about a minute.

A lost authenticator

  1. Sign in with your normal password. When Witen asks for your two-factor code, re-enter your password and use an unused ten-character recovery code. Each code works once.
  2. After signing in, open your user profile, disable the old 2FA setup, and enroll your replacement authenticator. Store the new recovery codes securely.
  3. If you have no recovery code, ask an administrator who can still sign in to reset your 2FA from your user profile.

Changed the security keys (salts) in wp-config.php? Witen encrypts each authenticator secret with those keys, so authenticator codes stop matching after a change. Recovery codes do not depend on the keys: sign in with one, then set two-factor up again. From 0.6.56 the sign-in screen says this itself, administrators see a notice with the number of accounts affected, and each profile says to set two-factor up again.

A site owner with WP-CLI access can reset one verified account. First identify the account, then replace 123 with its user ID:

wp user list --fields=ID,user_login
wp eval 'Witen_Two_Factor::disable(123);'

This removes that account’s Witen 2FA secret and recovery codes. Set up 2FA again right away. On Multisite, user accounts and 2FA enrollment are shared across the network.

A changed login URL

Use the custom login address saved under Witen → Login. If you have lost it, run WP-CLI from your WordPress installation:

wp option delete witen_login_slug
wp rewrite flush

Then open /wp-login.php. For Multisite, add --url=https://your-site.example to each command to select the affected site.

From 0.6.56, a renamed login is only at the address you chose. While it is renamed, /wp-admin/ answers “not found” to visitors who are not signed in, and /login, /admin, and /dashboard are ordinary missing pages, so none of them gives the address away. Keep a bookmark of your login address: links into the dashboard from emails show “not found” until you sign in there. Witen refuses a login address the site cannot serve, including any rename on a site with plain permalinks; if permalinks are later switched to plain, /wp-login.php works again.

Emergency access through your host

  1. Take a backup through your hosting panel or SFTP.
  2. Rename the witen-blocker folder under your WordPress plugins directory to witen-blocker-disabled. This stops Witen’s PHP login checks; it preserves settings.
  3. Try /wp-login.php. If Apache still blocks access, back up the site’s .htaccess, then remove only the sections between # BEGIN Witen Blocklist / # END Witen Blocklist and, when necessary, # BEGIN Witen Hardening / # END Witen Hardening. Preserve WordPress and other plugins’ sections.
  4. After recovering access, fix the cause, restore the folder name, and review Witen’s settings before reactivating it.

A Warden firewall block

When Warden runs on the same server, it blocks at the firewall, before a request ever reaches WordPress. WordPress reports to Warden but can never lift a firewall block. That’s deliberate: a hijacked admin account or plugin can’t open your server back up. In Witen → Firewall → IP Blocklist, these addresses are marked Held by Warden.

Lift the block from your host’s console or an already-open SSH session. Replace the example address with the blocked one. To list local bans and incoming downloaded entries, run the following command.

sudo warden blocked --source all

Locked out after failed sign-ins

From Witen Blocker 0.6.56, a lockout always happens: when Warden cannot be reached, is older than 0.1.47, or never receives the request, your site locks the address out itself and hands the lockout to Warden as soon as Warden has it. Lockouts your site holds are listed under Witen → Firewall with a Lift link. With Warden 0.1.48 or later, sudo warden unban ends a lockout your site holds as well, within about a minute; the Firewall page says whether your Warden passes unbans on. On older versions of Warden, the unban lifts only the firewall ban.

Once Warden takes over a lockout, use the server console to lift it. They end on their own after the site’s ban length, which Warden caps at one day by default. Warden can also lock an address out by itself after 20 failed sign-ins in five minutes across every site on the server, for an hour by default. An address that keeps hitting the firewall is held longer, up to seven days by default. Witen’s Login lockout settings say when Warden shortens a lockout or locks an address out first. To lift one now:

sudo warden unban 198.51.100.42

On the Witen blocklist

Unbanning doesn’t stick here: Warden refreshes the blocklist every five minutes by default and restores the address. Exempt it in Warden’s own never_block list in /etc/witen/warden.toml instead, then reload:

never_block = ["198.51.100.42"]
sudo warden reload

Warden lets the address through at the next refresh. WordPress’s Never-block list is a separate list: it exempts an address from WordPress checks and sign-in lockouts, but it doesn’t reach the firewall.

Check your trusted-address configuration before reconnecting. Switching Warden to the null backend does not lift an existing ban.

Continue with the Warden guide or WordPress setup guide.