Branding & Emails
Insert a Magic Link Merge Tag into Any Email
You want a working login link inside an email you already send — a receipt, a course-access message, an account notice — without building the URL by hand each time. Magic Link PRO gives you a merge tag for this: write {magic-link} (or {magic_link}) into the email content, and when WordPress sends the message the plugin swaps the tag for a fresh, secure login link generated for that recipient. This is a PRO feature.
PRO feature
The {magic-link} / {magic_link} merge tag is part of Magic Link PRO. It is not available in the free version.
What the merge tag does
The merge tag is a placeholder you put in email content. When the message is sent, Magic Link PRO replaces it with a one-click login link generated for the recipient at that moment. Both spellings work:
{magic-link}(hyphen){magic_link}(underscore)
The link is created per recipient at send time, so it is always fresh rather than reused.
How to insert the merge tag
-
Make sure Magic Link PRO is active on your site.
-
Open the email content you want to add a login link to — this can be one of your own emails or a message built by another plugin that lets you edit its body text.
-
Place the merge tag where you want the link to appear:
{magic-link} -
Save the email or template.
-
Send yourself a test message and click the link to confirm you are logged in.
When WordPress sends the email, the plugin replaces {magic-link} with a secure login link for the recipient, and clicking it signs them in with no username or password.

Where you can use it
The merge tag works in any email body that Magic Link PRO can filter before sending, which makes it useful for:
- Checkout and order emails
- Course-access emails
- Membership updates
- Account notifications
- Support follow-ups
How long the inserted link stays valid
Each link the merge tag produces follows your Token Lifespan and Token Validity settings, so it expires like any other Magic Link. Adjust those under Magic Link → Settings → General. See Magic Link expiry settings.
Merge tag versus automatic injection
There are two ways to get a login link into your emails, and they are different:
- This page — the merge tag. You decide exactly where the link goes by placing
{magic-link}in the content yourself. - Automatic injection. Magic Link PRO can append a login link to your site's outgoing emails for you, without editing each message. See Append a magic link to outgoing emails automatically.
Use the merge tag when you want control over placement; use automatic injection when you want it added everywhere without touching individual emails.
Conclusion
The {magic-link} merge tag lets you place a fresh, secure login link exactly where you want it inside any email you can edit, so passwordless access becomes part of messages you already send. If you would rather have a link added to every outgoing email automatically, see automatic login links, and to control how long each link lasts, review Magic Link expiry settings.
FAQs
Is the Magic Link merge tag free?
No. The {magic-link} / {magic_link} merge tag is a Magic Link PRO feature and is not available in the free version. Once PRO is active, you can place the tag in any email content you can edit, and the plugin replaces it with a login link when the message is sent.
What is the difference between {magic-link} and {magic_link}?
There is no difference — both spellings refer to the same merge tag and produce the same result. Magic Link PRO recognises the hyphenated and the underscored form, so you can use whichever matches the style of the plugin or editor you are working in.
Is the inserted link reused or fresh for each recipient?
It is fresh. Magic Link PRO generates a new, secure login link for each recipient at the moment the email is sent, rather than reusing one link. That link then obeys your Token Lifespan and Token Validity settings, so it expires the same way as any other Magic Link.
Can I use the merge tag in emails sent by other plugins?
Yes, as long as the other plugin lets you edit the email body text and its message passes through WordPress email sending. Place {magic-link} where you want the login link, save, and send a test to confirm the tag is replaced. If it is not, that plugin may send email in a way Magic Link cannot filter.
How long does a link from the merge tag stay valid?
Each link follows your Token Lifespan (how long before it expires) and Token Validity (how many times it can be used), set under Magic Link → Settings → General. Change those values to control expiry. See Magic Link expiry settings for details.