Skip to content

HandyPlugins

  • Home
  • PluginsExpand
    • Magic Login Pro
    • Handywriter
    • WP Accessibility Toolkit
    • PaddlePress Pro
    • Easy Text-to-Speech
  • Docs
  • About
  • Blog
  • Contact
My Account
HandyPlugins
Popular Search shortcodethehookemailredirect

Magic Login Pro

32
  • Installation & Configuration
  • Use magic login as the default login method?
  • Brute Force Protection
  • WooCommerce Integration
  • Easy Digital Downloads (EDD) Integration
  • Token Lifespan
  • Disable Magic Login for a Specific User
  • Login with Code: Flexible Passcode-Based Authentication
  • SMS Login – Passwordless Authentication with SMS
  • Magic Login REST API
  • CLI Command
  • Add Login form to a Page
  • Reset Tokens
  • Auto Login Links
  • Token Validity
  • Login Redirect
  • Shortcode
  • Login Email Customization
  • Login Request Throttling
  • IP Check
  • Domain Restriction
  • Registration
  • Spam Protection
  • How to Add Magic Login to Any of Outgoing Emails?
  • Customize Default Messages
  • nG Firewall
  • Dynamically Adjust Token TTL
  • How to change Sender Details?
  • Disable Magic Login for specific roles
  • Customizing Login Session Duration
  • Magic Login Twilio Integration
  • Magic Login – FluentCRM Integration

PaddlePress Pro

26
  • Installation & Configuration
  • How does PaddlePress PRO work?
  • Automatic account creation
  • How to set up a membership website?
  • Setup a Development Environment
  • Protect Download Files on NGINX
  • Software Licensing
  • Software Licensing API
  • Updater Implementation for WordPress Plugins
  • Updater Implementation for WordPress Themes
  • Release a New WordPress Product
  • Customer Dashboard (My Account) Page
  • Checkout Buttons
  • Custom Redirect After Successful Checkout
  • How does the domain count?
  • Emails
  • Accessing Readme through a Shortcode
  • How to Sell WordPress Products?
  • Releasing Beta Versions of a WordPress Product
  • Paddle Billing
  • Customer Dashboard
  • Membership Levels
  • Restrict Content
  • Add a Custom Payment Action
  • How to customize “Download” Button?
  • Adding Manual Payments

Handywriter

11
  • Installation & Configuration
  • Write a Blog Post
  • Create a Summary
  • Suggest a Title
  • Keep records of AI generated Contents
  • Grammar & Spelling Fixer
  • Plagiarism Check
  • Content Templates
  • How to create a Meta Description?
  • How to complete a sentence?
  • How does credit calculation work?

Easy Text-to-Speech

5
  • Installation & Configuration
  • Using with Block Editor
  • Using with Classic Editor
  • OpenAI Integration
  • ElevenLabs Integration

WP Accessibility Toolkit

3
  • Customization
  • Hotkeys: Quick Navigation and Efficiency
  • Do not show the accessibility toolkit on the specific page

FAQ

1
  • How to Enter Your VAT Number for VAT Deduction at Checkout
  • Home
  • Docs
  • Magic Login Pro
  • Registration
View Categories

Registration

Magic Login Pro offers flexible registration options to suit various needs and it works seamlessly with the magic login form.

Registration Mode #

3 different registration modes are available with Magic Login Pro.

1) Automatic registration

With automatic registration mode, users are not disturbed when attempting to log in. If the provided email address does not match any registered users, the system will automatically register the user. However, since Magic Login works with both email and username by default, you might prefer to display a small registration form to collect the user’s email address. Magic Login Pro offers an additional option to control this behavior, allowing you to choose whether to display a form with an email field or skip the registration process for such requests.

2) Standard registration

Standard registration is a great way to collect basic user details and integrates seamlessly with the magic login form. If a user’s email doesn’t match any existing accounts when requesting a login link, they will be directed to the registration form as the next step. In standard registration mode, you can request the user’s first and last name and ask them to accept the terms and conditions before proceeding with registration.

3) Registration with shortcode

If you want the registration process to be independent of the magic login, you can use the third option. Simply use the registration shortcode and attributes to display the registration form.

For instance:

[magic_login_registration_form show_name="true" require_name="true" show_terms="true" require_terms="true" registration_terms="I have read and accept <a href='#terms'> terms </a> " button_text="Complete registration and send login link" info_message="Continue with registration" success_message="Registration successfull, check your inbox for login link"]

Registration Email #

You can send registration email easily and it supports all the placeholders to customize email subject or content.

Domain Restriction #

The Domain Restriction feature allows administrators to limit user registrations to specific email domains. When enabled, only users with email addresses belonging to the allowed domains can register. This ensures that only authorized users from certain organizations or companies can create accounts.

Enabling Domain Restriction #

To enable the domain restriction feature:

  1. Navigate to the Settings -> Magic Login -> Registration settings page.
  2. Toggle the Enable domain restriction switch to the “on” position.
  3. Enter the allowed domain names in the provided text area, with one domain per line (e.g., example.com, example.net).
  4. Save the changes.

Once enabled, only users with email addresses matching the listed domains will be allowed to register.

Use Cases #

  • Restricting registration to employees of a specific company.
  • Limiting access to members of a particular organization.
  • Preventing spam or unauthorized signups from external email providers.

Important Notes #

  • The system performs a strict domain match, so subdomains (e.g., sub.example.com) will not be included unless explicitly listed.
  • Ensure that the domain list is kept up to date to accommodate changes in organizational email policies.

This feature provides an effective way to maintain control over user registrations and ensure that only authorized users can create accounts on your website.

You can use the magic_login_registration_allowed_domains filter to specify the allowed domains and the magic_login_registration_is_domain_allowed filter to programmatically determine whether a domain is permitted or not.

Set User Role #

Magic Login allows you to set a default user role for new registrations, giving you more control over user management. This feature ensures that newly registered users are automatically assigned the appropriate role, streamlining access control and improving site security.

Customizations #

If you are using a shortcode or automatic integration, the registration shortcode is always running behind the scenes. And it provides enough customizations and flexibility.

Don’t require last name:

add_filter( 'magic_login_registration_form_shortcode_atts', function ( $atts ) {
	$atts['require_last_name'] = false;

	return $atts;
} );

or alternatively you can pass require_last_name=”false” with shortcode.

Adding a custom field:

Let’s say you want to get the phone number with the registration form:

1) Following snippet for the adding a field to form:

/**
 * Add mobile phone field to the registration form.
 */
function my_prefix_add_mobile_phone_field() {
    ?>
    <p>
        <label for="mobile_phone"><?php esc_html_e( 'Mobile Phone', 'magic-login' ); ?></label>
        <input type="text" name="mobile_phone" id="mobile_phone" value="" required>
    </p>
    <?php
}
add_action( 'magic_login_registration_form_before_submit', 'my_prefix_add_mobile_phone_field' );

2) And handling data from backend:

/**
 * Assign phone information to the user after registration.
 *
 * @param int   $user_id  User ID.
 * @param array $userdata User data.
 */
function my_prefix_assign_phone_info( $user_id, $userdata ) {
    if ( isset( $_POST['mobile_phone'] ) ) {
        $mobile_phone = sanitize_text_field( wp_unslash( $_POST['mobile_phone'] ) );
        update_user_meta( $user_id, 'mobile_phone', $mobile_phone );
    }
}
add_action( 'magic_login_registration_after_user_create', 'my_prefix_assign_phone_info', 10, 2 );

The phone number will be saved as user meta.

How to Add a Red Asterisk (*) for Required Fields in Your Magic Login Registration Form #

To enhance the user experience on your Magic Login registration form, you may want to visually indicate which fields are required. A common way to do this is by adding a red asterisk (*) next to the labels of required fields.

The following code snippet demonstrates how you can dynamically add a red asterisk to the required fields in your form using a simple JavaScript solution:

add_action( 'wp_footer', function () {
	?>
    <script>
		document.addEventListener("DOMContentLoaded", function () {
			const requiredFields = document.querySelectorAll("#magic_login_registration_form input[required]");
			requiredFields.forEach(field => {
				const label = document.querySelector(`label[for="${field.id}"]`);
				if (label) {
					label.innerHTML += ' <span style="color: red;">*</span>';
				}
			});
		});
    </script>
	<?php
} );



PS: Registration feature is available since version 2.2+

Was this guide helpful for you?
Updated on March 5, 2025
Domain RestrictionSpam Protection
Table of Contents
  • Registration Mode
  • Registration Email
  • Domain Restriction
    • Enabling Domain Restriction
    • Use Cases
    • Important Notes
  • Set User Role
  • Customizations
    • How to Add a Red Asterisk (*) for Required Fields in Your Magic Login Registration Form

HandyPlugins

Explore

Home
Blog
Contact Us
My Account

Products

Magic Login Pro
Handywriter
Easy Text-to-Speech
PaddlePress Pro
WP Accessibility Toolkit

Follow Us

Twitter
Facebook
GitHub
WordPress

2025 – HandyPlugins.co | Hosted on WPHandle and optimized with Powered Cache

  • Terms and Conditions
  • Privacy Policy
  • Cookie Policy
  • Home
  • Plugins
    • Magic Login Pro
    • Handywriter
    • WP Accessibility Toolkit
    • PaddlePress Pro
    • Easy Text-to-Speech
  • Docs
  • About
  • Blog
  • Contact
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy