🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 23, 2026

How to Add Passwordless Magic Link Login to WordPress with Gravity Forms

GravityExtra
How to Add Passwordless Magic Link Login to WordPress with Gravity Forms

Passwords are the weakest part of most membership sites. People forget them, reuse them and type them wrongly on a phone, and every reset request lands in your support inbox. A magic link removes the password from the picture: the visitor types an e-mail address, receives a link, and one tap later is signed in. This guide shows how to set that up with Gravity Forms and, more importantly, what a safe setup must do so that the convenience does not become a hole in your site.

What a magic link really is

A magic link is a sign-in link that the server makes for one person and sends to the address of that person. Whoever can open the e-mail can sign in, so the whole security of the method rests on the inbox and on how the link is built. A good link has four properties: it is random, so nobody can guess it; it is single-use, so a copy is worthless after the first sign-in; it is short-lived, so an old e-mail is worthless; and it is stored as a hash, so a stolen database does not hand out sessions.

Those four properties are easy to say and easy to get wrong. A link built from the user number and a date can be guessed. A link that is checked but not marked used can be replayed. A link kept in the database as plain text turns every database backup into a list of sessions. The rest of this guide returns to these points step by step.

Why use a form for it

Gravity Forms already gives you what a sign-in request needs: a validated e-mail field, spam protection, conditional logic, AJAX and multi-page behaviour, your styling and a confirmation message. Building the request as a form means you can place it anywhere, on a landing page, in a pop-up or inside a checkout, and you can change the words without touching code. What Gravity Forms does not do is sign anyone in. That is the job of the add-on.

Step 1: build the form

Create a form with an Email field. If you want visitors without an account to get one, add a Name field too. Then write the confirmation. This is the most important sentence of the whole setup, so read it twice: the confirmation must say the same thing whether the address has an account or not.

Something like Thanks. If we can sign you in, a link is on its way is enough. A message such as No account was found for that address looks helpful, but it tells anyone who types addresses into the form which of them belong to your members. That is called user enumeration, and it helps attackers who send targeted phishing or try leaked passwords on your normal login page.

Step 2: add the feed

Open the form, go to Settings → Magic Link and add a feed. Pick the Email field, choose how long the link should live and set the page the visitor should land on.

The Magic Link feed settings in Gravity Forms: name, e-mail field, how long the link works, the page to go to after sign-in and an optional field for the page
One feed per form: which field holds the address, how long the link lives and where the visitor lands.
  • Choose 15 minutes or less unless your mail is slow. Most people open the e-mail at once. A long life only helps an attacker.
  • Set the landing page to a page on your own site, for example the account page. The add-on stores that page in the link and ignores anything that arrives later in the address or in a form post.
  • Keep Create an account off for a members-only site. Turn it on for a site where anyone may join with an address.

Why the destination is fixed

A sign-in link that accepts a redirect in the address is a classic open redirect. An attacker builds a link to your real site and adds a destination on their own site. The visitor trusts the first part, signs in and lands on a page that looks like yours and asks for a password. The add-on closes that door. The destination is decided when the link is made, stored with it, checked against your own site address, and never read from the request again. Addresses on other sites, addresses that start with two slashes, backslash tricks, user-name tricks and script addresses are all replaced by your own page.

Step 3: send the e-mail

The default message is short and plain. It carries the link, tells the visitor that it works once and says how many minutes it lasts. You can change the subject and the message and use {link}, {site_name} and {minutes}.

The sign-in e-mail: a short message with the one-time link and a note that it works once and expires in 15 minutes
The e-mail: one link, a note that it works once, and the time it lasts.

Deliverability deserves a word. A sign-in e-mail that takes five minutes to arrive is a bad sign-in. Send it with a proper mail service, set up SPF and DKIM for your domain, and test it with a few providers. The add-on uses the normal WordPress mail function, so whatever you have set up for password resets works here too.

Step 4: the page the link opens

Many mail programs and security gateways open every link in a message to check it for viruses. If your link signed people in when opened, the scanner would use it up before the person saw the e-mail, and the person would get an error. The add-on avoids this with a two-step design. Opening the link shows a small page with one button. Pressing the button sends a form post, with a form check made for that one link, and only then is the person signed in.

The sign-in page opened from the link: a card that says Sign in to the site with a single Sign in button
The page the link opens: one button, so a mail scanner that opens the link cannot use it up.

The page is never cached, is kept out of search results, sends no Referer to other sites and cannot be shown in a frame. The link appears once on it, in a hidden field, and nowhere else.

What can go wrong, and what the add-on does about it

Someone guesses a link

A link holds 256 random bits. That is not a number you can try. Even so, the add-on limits how often one connection can try to use links, and every failed try looks the same.

Someone uses a link twice

The database marks a link used in a single step that only one request can win. Two people pressing the button at the same moment, a double click, a replayed post: exactly one gets in.

Someone floods the form

By default one address can get three links in 15 minutes and one connection can make ten requests. Every request counts, including requests for addresses that do not exist, so the limit does not reveal which addresses are real. A visitor who hits a limit sees the usual confirmation and just gets no new e-mail.

Someone changes the database

The stored rows hold only hashes, so a copy of the table gives nobody a session. Each row is also signed with your site keys. If a row is changed, for example to point at another user or another page or to live longer, the signature no longer fits and the link is refused.

Someone asks for the link of an administrator

The form answers as always, but no e-mail is sent. Administrators, editors, shop managers and any account with a management capability can never use a link, and the rule is checked again when the link is used. If you ever promote an account after its link was sent, the old link is refused.

Letting new visitors in

If your site is open to everybody, turn on Create an account. The account is not made when the form is sent, only when the link is opened. That order matters. An account made at once would let anyone fill your user list with addresses that are not theirs. Making it at the moment the link is opened proves that the person controls the address.

New accounts get the role you choose, Subscriber by default. The role list never offers Administrator or Editor, and a role that carries a management capability is replaced by Subscriber even if someone edits the feed by hand. The account gets a long random password that nobody sees, so there is nothing to steal.

A short checklist before you go live

  1. Send a link to a test member and open it on a phone. Check where you land.
  2. Press the link a second time and confirm that it says the link does not work.
  3. Ask for a link for an address that has no account and for the address of an administrator. Confirm that the confirmation looks identical and that no e-mail arrives.
  4. Request four links in a row for one address and check that the fourth does not arrive.
  5. Look at the sign-in e-mail in your own mail program, with images off. It should read well as plain text.
  6. Ask your host or a developer to check that your cache does not store pages with a gfml query.

Magic link or password?

A magic link is not always the better choice. It shifts trust to the inbox. For members who already use a good mail account with two-step sign-in, that is a fine trade: they sign in faster and cannot reuse a weak password. For administrators it is not, which is why the add-on excludes them. Keep the normal login for them, with a strong password and a second step.

For a membership site, a client area, a booking page or an event portal, where the people on the other side are customers and not staff, a link by e-mail is usually what they would choose if you asked them.

Questions

Do the visitors need to remember anything?

No. They need access to their e-mail. If they lose it, they use the way they would use to reset a password.

How long does a link last?

You choose between 5 and 60 minutes in each feed. The default is 15.

Can I send people back to the page they came from?

Yes. Use a hidden field that holds the page and pick it in the feed. The value is checked when the link is made, and pages on other sites are replaced by your own page.

Does it work with Gravity Forms 2.9?

Yes. It is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.

Get started

The Gravity Forms Magic Link Login Premium Add-on turns any Gravity Forms form into a safe, passwordless sign-in. See the features, the price and the setup guide on the add-on page.

See the Magic Link Login add-on

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr