Sign-in
Magic links for locked-out users
Lets a real user who has been locked out ask for a one-time sign-in link by email, instead of waiting for the lockout to end or calling you.
What it does
When brute force protection locks out an address, the sign-in page offers to email a magic link. The user types their username or email address, and if their address really is locked out, a link arrives in their inbox.
Clicking the link lifts the lockout on their address and signs them in. If they use two-factor sign-in, they still have to pass the second step.
Why it matters
Strict lockouts stop robots, but they also catch people who mistype a password a few times. Magic links let you keep lockouts strict without locking your own team out.
Set it up
- Make sure Brute Force Protection is on: magic links only appear for locked-out addresses.
- On the Login tab, section Sign-in security, switch on Magic Links.
- Set Link Expiration: how many minutes a link works. 15 is the default.
- Click Save Changes, and check that your site can send email (the Notifications tab has a test button).
Good to know
The page gives the same answer whether or not the account exists, so it cannot be used to find usernames.
One link per user every 2 minutes, and each link works once. Asking for a new link cancels the old one.
The link lifts the lockout on the address. A lockout on the username itself (the Pro per-user limit) stays until it runs out.
Which plan includes it
Magic links are part of Pro.
How it works, for developers
- Links carry a 64-character random token in
?smg_magic=; only a hash of it is stored, in thesmg_magic_linkstable. Links are handled oninitat priority 5. - Requests go to the
smg_request_magic_linkAJAX action, which is open to visitors who are not signed in and is rate limited per user (one per 2 minutes) and per address. - A link is only sent when the requesting address is locked out right now. Using it clears
locked_untilfor that address insmg_login_attempts. - Expired links are removed daily by the
smg_cleanup_magic_linksscheduled task. - Settings:
smg_magic_links_enabled,smg_magic_link_duration(minutes).
Quick answers about magic links for locked-out users
What does Magic links for locked-out users do in Stack Guard?
When brute force protection locks out an address, the sign-in page offers to email a magic link. The user types their username or email address, and if their address really is locked out, a link arrives in their inbox. Clicking the link lifts the lockout on their address and signs them in. If they use two-factor sign-in, they still have to pass the second step.
Why use magic links for locked-out users on a WordPress site?
Strict lockouts stop robots, but they also catch people who mistype a password a few times. Magic links let you keep lockouts strict without locking your own team out.
How do I set up magic links for locked-out users?
1. Make sure Brute Force Protection is on: magic links only appear for locked-out addresses. 2. On the Login tab, section Sign-in security, switch on Magic Links. 3. Set Link Expiration: how many minutes a link works. 15 is the default. 4. Click Save Changes, and check that your site can send email (the Notifications tab has a test button).
Which Stack Guard plan includes magic links for locked-out users?
Magic links are part of Pro.
More in Sign-in
- Login GuardMoves your sign-in page to an address only you know, so the robots that try passwords on every WordPress site cannot find it.
- Sign-in errors and sessionsStops the sign-in page from telling strangers which usernames exist, signs out sessions left idle, and caps how long "Remember me" keeps someone signed in.
- Two-factor authenticationAdds a second step to signing in: after the password, a code from a phone app or an email. A stolen password alone is no longer enough to get in.
- Brute Force ProtectionStops password guessing by locking out anyone who gets the password wrong too many times in a row.
- CAPTCHAAdds a quick "are you human?" check to your sign-in, sign-up, password reset and comment forms, so robots cannot use them.
Not running Stack Guard yet? It is free.
Download Free