Skip to content
GPLWP Guides

How to enable passwordless login on WordPress

SecurityWordPress Time About 30 minutes with a plugin 6 steps Updated 3 Dec 2026

SECURITY
The short answer

WordPress does not include a built-in passwordless login setting. You need a custom plugin or a passwordless-login plugin that emails a short-lived, single-use magic link, validates it and creates the normal WordPress login cookie.

The route
  1. 01Choose the login model
  2. 02Build the manual flow
  3. 03Complete the token login
  4. 04Fix email delivery first
  5. 05Test the awkward cases
  6. 06Take the fast plugin route

What you need

  • Administrator access to WordPress
  • HTTPS enabled on the site
  • A working email-sending method
  • A backup or staging copy before changing login behaviour

Choose the login model

Passwordless login normally means that a user enters an existing account email address, receives a temporary magic link and clicks it to authenticate. The link should be short-lived and single-use. It proves control of the email account, so protect that mailbox as carefully as the WordPress account.

Decide whether passwords will remain available as a fallback. Keeping the normal administrator login and an emergency recovery route is sensible while you verify the new flow.

Build the manual flow

WordPress core does not provide a passwordless login setting, so a manual implementation needs custom plugin code. The plugin should display an email form, look up the existing user, create a random temporary token, store enough server-side data to validate it, and send the link with wp_mail(). WordPress documents wp_mail() as a sender, but a successful return value does not prove that the message reached the inbox.

Use a generic response for both known and unknown email addresses so visitors cannot use the form to discover registered accounts. Add rate limits, a nonce for the request form, an expiry time and a way to invalidate earlier tokens.

Complete the token login

When the link is opened, your code must validate the token, check its expiry and user, reject a token that has already been used, then mark it unusable before creating the normal WordPress session with wp_set_auth_cookie(). That function is the core API for setting authentication cookies for a user ID.

Allow only safe, known redirect destinations. Do not put the user ID or an unprotected reusable secret in the URL, and do not treat a normal WordPress nonce as a replacement for the email login token: nonces are intended to help protect actions and requests, not to authenticate an unknown visitor.

Fix email delivery first

Configure authenticated SMTP or another reliable mail route before switching users over. WordPress's mail function can hand a message to the local mail system without proving delivery, so a magic-link system can appear broken when the real problem is spam filtering, sender reputation or hosting restrictions.

Send a test to Gmail, Outlook and a work mailbox. Check junk folders, the sender address and your mail logs. The Friday failure to plan for is a link that was sent successfully by WordPress but never reached the user's inbox.

Test the awkward cases

Test an unknown email, a mistyped address, an expired link, a second click on the same link, two login requests in quick succession, logout, the administrator area and a redirect back to the page where the request began. Confirm that the response does not reveal whether an email belongs to a user.

Some corporate email security gateways open links before the recipient does. If your login action happens immediately on a GET request, the gateway can consume a single-use token and leave the person with an expired-link error. Use a confirmation step or a code exchange that does not complete authentication until the user actively confirms it.

Take the fast plugin route

For most sites, install and configure Magic Login Pro instead of maintaining the token flow yourself. It is designed for email magic-link authentication, so it is a better fit when simpler login matters more than social-provider support.

Use the plugin's setup screen to enable the magic-link form, set a short token lifetime, choose the redirect behaviour and place the form on the login page or a dedicated page. Keep SMTP configured, retain an administrator recovery route, and test the link in the same browser and on a second device before replacing the normal login.

The fast route

Let Magic Login Pro do it

Email magic-link authentication for password-free access; choose it when simpler login matters more than social-provider support.

Get Magic Login Pro

Sources

  1. wordpress.org /plugins/passwordless-login/?utm_source=openai
  2. developer.wordpress.org /reference/functions/wp_mail/?utm_source=openai
  3. developer.wordpress.org /reference/functions/wp_set_auth_cookie/?utm_source=openai
  4. developer.wordpress.org /reference/functions/wp_create_nonce/?utm_source=openai
  5. docs.testplanit.com /docs/user-guide/passwordless-sign-in/?utm_source=openai
  6. itu.int /rec/dologin_pub.asp?id=T-REC-X.1283-202409-I%21%21PDF-E…

Questions

Does WordPress support passwordless login without a plugin?
No. WordPress core does not include a passwordless or magic-link login setting. You can build it as a custom plugin that creates and emails temporary tokens, validates them and calls <code>wp_set_auth_cookie()</code>, but that means maintaining security, expiry, rate limiting and email-delivery code yourself. For a normal site, a maintained passwordless-login plugin is the shorter route. <span></span>
Are magic links safer than WordPress passwords?
Magic links remove password reuse and weak-password risks, but their security depends heavily on the user's email account. Anyone who can access that mailbox may be able to log in, so use short-lived, single-use tokens, HTTPS, rate limits and a recovery plan. Passwordless email login is also not automatically suitable as the only protection for high-risk administrator access. <span></span>
Why is the passwordless login email not arriving?
The usual causes are unreliable WordPress mail delivery, spam filtering, an invalid sender address or hosting that blocks outgoing mail. A true result from <code>wp_mail()</code> only means that the mail method processed the request; it does not confirm inbox delivery. Configure SMTP or another authenticated mail service, then check spam folders and mail logs before changing the login code. <span></span>
Why does a magic link say it has expired before it is clicked?
An email security scanner may have opened the link before the recipient did. This is common with single-use links that complete login immediately when the URL is requested. Add an intermediate confirmation page, use a code exchange, or choose a system that accounts for link scanners. Also check the token lifetime, server time and whether the email was opened in a different browser or device. <span></span>