I came across this post on X today about a free Gravity Forms add-on that generates a magic link users can use to log in to your WordPress site instead of using a password.
I was intrigued, so I took a few minutes to test this add-on out and see how it worked.
How It Works
We’ve all seen sites that allow you to log in with a username/password or a magic link. This usually annoys me because using my username/password is faster than waiting for a link.
But maybe this is better for someone who has trouble remembering passwords or doesn’t use 1Password.
This add-on might be a good choice if you want an easy solution for a magic link login on your site.
For this to work, the user must have a registered account on your site and use the email associated with that account when they fill out the form.
When all those things line up, the user will receive an email with their magic link. When they click on that link, they will be redirected to your site and automatically logged in.
Below is a quick tutorial to explain how to set this up and start using this fantastic (I initially wrote awesome, but Grammarly made me change it to fantastic) add-on.
Installing the Plugin
You can download the zip file from the Github repo and install it like any other plugin, or you can copy the code from the gform-magic-link.php file and add it to your themes functions.php file or use a code snippet plugin.
Building the Form
Now that the plugin is “installed” and activated, we can build our form.
The author has provided a form you can import that is all setup and ready for use. You can also download it from the Github repo.
What Your Form Needs
- An Email field
- Dynamic Population enabled for the email field and the parameter magic_link
- A custom Notification with a link in the message, something like this:
This is your <a href="{magic_link}">magic link to login</a>.
Embedding the Form
Now that your form is built and ready, you can embed it on a page and see the magic.
Here is a quick demonstration for your viewing pleasure.
The Wrap Up
As you can see, this simple-to-use add-on offers a really cool feature: it gives your users a quick way to log in to your site without requiring a pesky password.
Despite my annoyance with these types of login features, this is an excellent add-on that will come in handy when we launch our membership site.
I’ve included the original X post below so you can follow the author and tell him how much you like his add-on.