CLI Command

You can use WP-CLI to generate a magic link URL for any existing user:

magic-login create <user> [--count=<count>]

for example if you want to create a 2 login links for the admin user

wp magic-login create admin --count=2

and output will be something like


In version 1.3.1, `redirect-to` parameter has been added! You can easily specify the redirection URLs.


wp magic-login create admin --count=1 --redirect-to=''

You can pass the optional --send parameter if you want to send the login link right away.

Bulk Login URLs:

If you need to create role based urls for the group of users, you can do that too.

wp magic-login bulk-create --format=csv --role=contributor > login-links.csv

PS: The login links generated via CLI will skip the IP Check even if you have enabled that option.