---
title: Disable Magic Login for a Specific User
description: "You can disable magic login for a specific user easily by following these steps: 1. Navigate user profile 2. In their profile settings, find the option labeled \"Disable Magic Login for this user.\" 3. Check the box next to this…"
url: "https://handyplugins.co/docs/disable-magic-login-for-a-specific-user/"
updated: "2025-01-28"
category: Magic Login Pro
---

# Disable Magic Login for a Specific User

You can disable magic login for a specific user easily by following these steps:

1. Navigate user profile
2. In their profile settings, find the option labeled "Disable Magic Login for this user."
3. Check the box next to this option to disable magic login for the user.
4. Click "Update User" to apply the changes.

![](data:image/gif;base64,R0lGODdhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs=)

By default only users who has "edit_users" capability have access this feature, you can use `magic_login_current_user_can_control_user` filter to control capability.

For example, if you want to allow subscriber-level users to disable/enable magic login, you can use this snippet:

```
function can_current_user_control_magic_login($status) {
	$current_user = wp_get_current_user();
	return current_user_can('edit_user', $current_user->ID);
}

add_filter('magic_login_current_user_can_control_user', 'can_current_user_control_magic_login');
```

Since Magic Login stores metadata to determine whether it's disabled for a user, you can programmatically control this behavior by filtering the meta value. For example:

```
add_filter( 'get_user_metadata', function ( $value, $user_id, $meta_key, $single ) {
	// Check if the requested metadata is for the magic login disable feature
	if ( $meta_key === MagicLoginConstantsDISABLE_USER_META ) {
		// Get the user object
		$user = get_userdata( $user_id );

		// Check if the user has the 'administrator' role
		if ( in_array( 'administrator', (array) $user->roles, true ) ) {
			return true; // Disable magic login for admins
		}
	}

	return $value;
}, 10, 4 );
```

*(disables magic login for admin users)*
