Limit passwordless sign-in by role
Passkeys and magic links each have an Allowed roles setting. Use it to decide which kinds of users can sign in without a password. The two features are limited separately, so you can allow one and not the other.
Where the settings are#
- Go to Settings → Login Shield and open the Passwordless tab.
- Find Allowed roles in the Magic link (email login) section, and again in the Passkeys (WebAuthn) section.
- Tick the roles you want to allow.
- Click Save passwordless settings.

How the setting works#
| What you tick | Result |
|---|---|
| Nothing ticked | Every role is allowed. This is the default. |
| Some roles ticked | Only those roles are allowed. Everyone else is not. |
This is the opposite of the 2FA role setting. For 2FA, you must keep at least one role ticked. For passwordless sign-in, “none ticked” means “all roles”. If you want to turn passwordless sign-in off for everyone, turn off Enable passkeys or Enable magic link instead.
A user with several roles is allowed if any of their roles is ticked.
A role you add later is not allowed once you’ve ticked specific roles. Tick it if you want it.
What happens to a user who isn’t allowed#
Passkeys
- On the Login & security page in wp-admin, the Passkeys card says “Passkey sign-in is not allowed for your account’s role.” and has no Add button. On the front end (My Account or the shortcode) the Passkeys card is not shown at all.
- If the user already has a passkey and signs in with it, the sign-in is denied: “Passkey sign-in is not enabled for your account.” The attempt is recorded in the Log tab (“Passkey login denied: role not permitted”).
- Their existing passkeys are not deleted. They work again if you allow the role.
Magic links
- The request form shows the same neutral message as for everyone: “If an account exists for that address, a login link has been sent.” No email is sent. This stops anyone from learning which roles exist.
- If a link was already emailed before you changed the setting, clicking it is refused, and the attempt is logged.
- The Email login link row doesn’t appear for them on the Login & security page.
In both cases the user can still sign in with their password.
Who to allow#
| Role | Passkeys | Magic links |
|---|---|---|
| Administrator | Good. Passkeys are strong and phishing-resistant. | Think twice. An email inbox then unlocks an admin account. |
| Editor, Shop manager | Good | Your call |
| Customer, Subscriber | Good, if users have modern devices | Often useful. It saves a forgotten-password reset. |
This is a starting point, so adjust it to your site.
A common setup: passkeys for everyone, and magic links only for customers.
How this fits with 2FA#
Limiting a role does not change 2FA:
- A user who signs in with a passkey skips the 2FA code if Passkey sign-in satisfies 2FA is on.
- After a magic link, a user who has added an authenticator app or passkey is still asked for that second step. A user who only has email codes is not asked again, because the link already proved they can read that inbox.
- A passkey can also be a 2FA method for a password sign-in. That depends on the 2FA tab settings.
See “How 2FA works” and “Choose which roles use 2FA”.
Roles and WooCommerce#
The WooCommerce option on each feature controls whether the button appears on the My Account login form. The role limits apply there too.
For developers#
You can override the role decision with filters:
nahnls_passkey_user_allowed( $allowed, $user )nahnls_magic_link_user_allowed( $allowed, $user )
For example, you can allow a specific user by capability instead of role. See the Developer API docs.
Troubleshooting#
- A user can’t add a passkey: their role isn’t ticked, passkeys are off, or the site isn’t on HTTPS.
- A user says no login link arrives: their role isn’t ticked, they opted out, the account has no email address, or email delivery isn’t working. The form shows the same message in every case.
- Everyone is blocked after ticking a role: you ticked a role no one belongs to. Tick the right roles, or untick all to allow everyone.
- A new role can’t use passwordless sign-in: you’ve ticked specific roles. Tick the new role too.
Was this helpful?
Thanks for your feedback!
✓ Feedback received. Thank you!