🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Magic Link Login Premium Add-on Setup Guide

Updated 10 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Install and activate
  4. Build the sign-in form
  5. Add a feed
  6. New visitors
  7. What the visitor goes through
  8. How the links are protected
  9. No user enumeration
  10. Who can never use a link
  11. Limits on requests
  12. Redirect rules
  13. For developers
  14. Good to know
  15. Troubleshooting
  16. Questions
  17. Does it replace the WordPress login page?
  18. Does it need an outside service?
  19. Can members be signed in on any device?
  20. What happens if my license expires?
  21. Which Gravity Forms versions are supported?

Video walkthrough

Gravity Forms Magic Link Login: Passwordless Sign-In Links by Email (Single-Use)
Video tutorial: Gravity Forms Magic Link Login Watch on YouTube

The Gravity Forms Magic Link Login Premium Add-on lets people sign in to your WordPress site without a password. A Gravity Forms form asks for an e-mail address. The add-on e-mails that address a single-use, short-lived sign-in link. When the person opens the link and presses one button, WordPress signs them in and sends them to the page you chose. If the address has no account yet, the add-on can create one at that moment.

Security is the whole point of the add-on, so this guide explains what it does and what it refuses to do. In short: links are random, work once, expire in minutes and are stored only as hashes. The form answers the same way whether or not an account exists. Each link is tied to one person and one page on your own site. Administrators and every other account that can manage the site are excluded and cannot be switched back on.

What you need

  • WordPress 6.5 or newer and PHP 7.4 or newer.
  • Gravity Forms 2.9 or newer. The add-on is tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • An active license key for this add-on.
  • A site that can send e-mail reliably. A link that arrives in the spam folder is a link nobody uses, so use an SMTP or mail delivery service if your hosting mail is unreliable.

If Gravity Forms is missing or older than 2.9, the add-on shows a notice in the WordPress admin and does nothing else.

Install and activate

  1. Install and activate the add-on like any plugin, after Gravity Forms.
  2. Open Forms → Settings → Magic Link and enter your license key.
  3. In the same screen check the safety settings: the extra roles that can never use a link and the two limits.

Build the sign-in form

The form can be as small as one field. Add an Email field and, if you want the add-on to create accounts, a Name or text field for the display name. Then write the confirmation message. Because the add-on never tells the visitor whether an account exists, the message must read the same for everybody. A good text is:

Thanks. If we can sign you in, a link is on its way. Check your inbox in a minute. The link works once and lasts 15 minutes.

Put the form on any page, in a widget or in a block. It works with page forms and with AJAX forms, with multi-page forms and with conditional logic.

Add a feed

Open the form and go to Settings → Magic Link, then add a feed. A form can have several feeds, each with its own conditional logic, for example one feed for members and another for guests.

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.
  • E-mail field: the Email field that holds the address. Every address is lower-cased and checked. An address with a line break, a second address or any odd character is ignored.
  • Link works for: 5, 10, 15, 30 or 60 minutes. Shorter is safer. The default is 15 minutes.
  • After sign-in go to: a page of your own site, for example /my-account/, or the full address of a page on your site. See the redirect rules below.
  • Or take the page from a field: an optional hidden or text field, for example a hidden field filled from a query string, so one form can send people back to the page they came from. The value is checked when the link is made and then fixed.
  • Subject and Message: the e-mail. Use {link}, {site_name} and {minutes}. If the message has no {link} the link is added at the end.

New visitors

With Create an account off, only people who already have an account get a link. An unknown address gets no e-mail, and the visitor sees exactly the same confirmation. With it on, an unknown address gets a link too, and the account is made when the link is opened, never before. Opening the link proves that the person controls the address, which is exactly what an e-mail confirmation is for.

  • Role of new accounts: Subscriber by default. The list never shows Administrator, Editor or Shop Manager, and even if a feed is changed by hand to name one of them, or any role that has a management capability, the new account gets Subscriber.
  • Name field: used as the display name of the new account. The user name is made from the part of the address before the at sign and made unique.
  • The new account gets a long random password that nobody sees. The person can set a password later on the profile screen, or keep using links.

What the visitor goes through

  1. The visitor types an address and sends the form. They see your confirmation.
  2. If the address belongs to an allowed account (or may become one), an e-mail with the link goes out a moment after the page has been shown.
  3. The visitor opens the link. They see a small page with one Sign in button. Nothing has happened yet.
  4. They press the button. WordPress signs them in and sends them to the page that was fixed when the link was made. The link is used up.
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.
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 extra button matters. Many mail programs and security gateways open every link in a message to check it. If the link signed people in by itself, that check would use it up, or worse, sign the scanner in. Here, opening the link only shows the button; the sign-in happens when the button is pressed, with a one-time form check that belongs to that link.

  • Random and single-use. A link carries 256 random bits. The database marks it used in one atomic step, so even two people pressing the button at the same moment cannot both win.
  • Short-lived. Five to 60 minutes, never more, whatever a feed says.
  • Hashed at rest. The database holds only a keyed hash of the link, made with your site keys, so someone who reads the table cannot sign in. The rows are also signed, so a row changed in the database (another page, another user, a longer life) is refused.
  • Only the newest link works. Asking for a new link cancels the old one.
  • Bound to a page. The page to land on is stored with the link and is never read from the web address or the form post again. Addresses on other sites, protocol-relative addresses, backslash tricks, user-name tricks and script addresses are all refused and replaced by the feed page.
  • Form check. The sign-in button posts a nonce made for that one link. A forged post from another site does nothing.
  • Nothing in logs. The add-on writes no link to any log, entry note or option. The only place a link appears is the e-mail you send.
  • No leaks from the page. The link page is never cached, is not indexed, sends no Referer to other sites and cannot be put in a frame.

No user enumeration

A form that says that no such user exists is a gift to anyone who wants a list of your members. This add-on answers every request the same way: known address, unknown address, an administrator, an address that is not valid, a request that hit a limit. The confirmation is yours and says the same thing every time, and the e-mail is sent after the page has been answered, so the time taken does not give the answer away either. The entry note in the admin says only that the request was handled.

Administrators, editors and shop managers are excluded, and so is every account that has a capability to manage the site: options, plugins, themes, users, other people’s posts, Gravity Forms settings and forms, and the network in a multisite. This is checked by capability, so a custom role with an innocent name is still refused. The check runs when the link is requested and again when it is used, so an account promoted in between is refused too. In the plugin settings you can add more roles, such as Author. You cannot remove the built-in ones.

Limits on requests

  • Per address: by default 3 links per address in 15 minutes.
  • Per connection: by default 10 requests per visitor connection in 15 minutes. Every request counts, valid or not, so the limit cannot be used to find out which addresses exist.
  • A visitor over a limit sees the same confirmation and simply gets no new e-mail until the window has passed.
  • Sites behind a proxy or a content network should give the add-on the real visitor address with the gfml_client_ip filter, otherwise every visitor shares one connection limit.

Redirect rules

The page after sign-in is chosen when the link is made. A path such as /my-account/ or a full address on your own site is accepted. Everything else is replaced by the page set in the feed, and if that is not valid either, by the home page. If you really need a second domain, for example a shop on another host of yours, allow it with the gfml_allowed_redirect_hosts filter. Nothing else changes the rule.

For developers

  • gfml_is_privileged_user( $user_id ): true when the add-on would refuse that account.
  • Filter gfml_is_privileged: treat more accounts as privileged. It can only add, never remove.
  • Filter gfml_client_ip: the address used for the limits.
  • Filter gfml_allowed_redirect_hosts: extra hosts that links may lead to.
  • Filter gfml_redirect: change the page after sign-in. The result is checked again.
  • Filter gfml_new_user_data: change the data of an account the add-on creates, or return false to refuse it.
  • Action gfml_signed_in: runs after a person signed in with a link (user id, feed id). WordPress’ own wp_login action runs too, so other plugins see the sign-in.

Good to know

  • Sign-in is a normal WordPress sign-in. The cookie is the standard one, without Remember me. A plugin that adds a second step to the password form does not see a link sign-in, which is exactly why administrators are excluded.
  • The link is in the e-mail. Anyone who can read that inbox can use the link while it is valid, as with every password reset. A short life and one use keep that window small.
  • Web server logs. A web address is written to the server’s access log when it is opened. The add-on cannot change that; a used or expired link is worthless in a log.
  • Page caching. The link page and the sign-in post send no-cache headers. Make sure your cache does not store the home page with a gfml query.
  • Not in version 1.0.0. Sign-in for administrators, passkeys, links by text message and a built-in sign-in form. You build the form with Gravity Forms.

Troubleshooting

  • No e-mail arrives: check the license, that the feed is active and that the address belongs to an account (or that Create an account is on). Test your site’s mail with a password reset. Remember the limits: 3 links per address in 15 minutes.
  • The link says it does not work: it was used, it has expired, a newer link was asked for, or the account is an excluded one. All failures look the same by design.
  • Everybody is limited at once: your site sees one connection address for all visitors. Use the gfml_client_ip filter.
  • Landing on the home page: the page you set was not on your site, or the field value was refused.

Questions

Does it replace the WordPress login page?

No. It adds a second way in. The normal login page keeps working for everybody, including administrators.

Does it need an outside service?

No. Links are made and checked on your server and sent with your site’s normal e-mail. No account at another company and no API key are needed.

Can members be signed in on any device?

Yes, on the device where the link is opened. Every sign-in is a separate WordPress session.

What happens if my license expires?

Nothing is sent and old links stop working. The form still submits normally.

Which Gravity Forms versions are supported?

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

Still need help?

Our support team answers tickets every day, usually within a few hours.

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