Everyday Use
Add a Magic Link Login Form with a Shortcode
Want a passwordless login form on a custom page instead of the default WordPress login screen? Add the [magic_link_form] shortcode to any page, post, or widget and it renders a form where visitors enter their email and receive a one-click sign-in link. The shortcode is free and works anywhere WordPress runs shortcodes.
What the Magic Link shortcode does
[magic_link_form] outputs a passwordless login form. A visitor types their email address, requests a link, and receives an email with a secure Magic Link that logs them in without a password. You control the form's behavior with two optional attributes.
Add the shortcode
- Edit the WordPress page, post, or widget where you want the login form.
- Paste
[magic_link_form]into the content (use a Shortcode block in the block editor, or type it directly in the Classic editor or a text widget). - Publish or update.
Visitors can now request a Magic Link straight from that page.
You can also use [magic-link] or [magic_link] — both are aliases that render the same form.
Shortcode attributes
| Attribute | Values | Default | What it does |
|---|---|---|---|
redirect |
Any URL | (empty) | Where the visitor lands after logging in. Leave empty to use your global setting under Magic Link → Settings → General. |
show_registration |
true / false |
true |
Shows or hides the account-creation option for visitors whose email is not yet registered. |
Examples
- Basic form:
[magic_link_form] - Redirect users to a page after login:
[magic_link_form redirect="/my-account"] - Hide the registration option:
[magic_link_form show_registration="false"]
Where to add it
- Any WordPress page or post — a dedicated Login page, a members-only landing page, or a checkout page.
- A Shortcode block in the block editor.
- Classic editor content, text widgets, or page-builder shortcode elements.
Shortcode or block?
Both produce the same form and the login itself works identically. Use the shortcode for widgets, page builders, or theme templates that do not use the block editor. If you are building in the block editor, the Magic Link Login Form block is easier to set up and clearer for the next person who edits the page.
Conclusion
The [magic_link_form] shortcode gives you a passwordless login form on any WordPress page in seconds, with an optional redirect and registration control. Once it is live, set a sensible link lifespan under Magic Link expiry settings and decide where users go next with redirect after login.
FAQs
What is the Magic Link login shortcode?
[magic_link_form] is a free shortcode that renders a passwordless login form on any WordPress page, post, or widget. Visitors enter their email address and receive a secure one-click sign-in link, so they log in without a password. The aliases [magic-link] and [magic_link] render the same form.
Can I redirect users to a specific page after they log in?
Yes. Add the redirect attribute with the destination URL, for example [magic_link_form redirect="/my-account"]. If you leave it out, the form uses the global login redirect set under Magic Link → Settings → General. See redirect after Magic Link login for more control.
How do I hide the account registration option?
Set show_registration="false", for example [magic_link_form show_registration="false"]. The registration checkbox only appears when this attribute is true (its default) and account creation is enabled for your site, so unregistered visitors cannot create an account from the form when it is hidden.
Is the Magic Link shortcode free?
Yes. The [magic_link_form] shortcode and its redirect and show_registration attributes are part of the free Magic Link plugin. No PRO license is required to add a passwordless login form to your pages.
Can I add the form without using a shortcode?
Yes. Magic Link includes a Magic Link Login Form block for the WordPress block editor. It renders the same form and lets you set options from the sidebar instead of typing attribute names, which is easier for anyone who edits the page later.