WPCode
93Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
Use WP-CLI to generate a one-time login URL for any user
One Time Login is a WordPress plugin that allows you to generate one-time login URLs for existing user accounts. This is useful when you need temporary access without creating new user accounts. The plugin works through WP-CLI commands or the WordPress API, enabling you to specify the number of tokens and whether to delay their deletion.
This plugin is suitable for developers or site administrators who need to provide temporary access to users for specific tasks without compromising account security. It simplifies the login process by eliminating the need for permanent user accounts.
Best for: This plugin is best for developers or administrators managing user access on WordPress sites.
What it does well
Where it falls short
One Time Login offers a straightforward solution for generating temporary access links, but it may require technical knowledge to use effectively.
Daniel Bachhuber's own description of One Time Login, lightly tidied.
Need access to a WordPress install but don’t want to create a new user account? Use this plugin to generate one-time login URLs for any existing user.
Then, copy the URL, paste it into your web browser, and… voila!
Because they are one-time login URLs, they will only work once. If you need access again, you’ll need to run the WP-CLI command again.
wp plugin install one-time-login --activate && wp user one-time-login <user> --count=3 --delay-delete
After you run the command above, you’ll see a success message like this:
http://wpdev.test/wp-login.php?user_id=2&one_time_login_token=93974b48e3a418b895fc7ca476f1a607d8b99345
Or like this if you asked for more than one:
http://wpdev.test/wp-login.php?user_id=1&one_time_login_token=2b9c6f5d71d51d530e397ee9da3b50e4e3dd06e7
http://wpdev.test/wp-login.php?user_id=1&one_time_login_token=90897da439a116c613fc1c49c372e6b1f7c72ad8
http://wpdev.test/wp-login.php?user_id=1&one_time_login_token=68c8074743de849db606500c3caa39a7432dc601<h3>Parameters</h3>
* count: Generate more than one login token (default: 1);
* delay-delete: Delete existing tokens after 15 minutes, instead of immediately.
curl -X POST \
http://wpdev.test/wp-json/one-time-login/v1/token
-H 'authorization: Basic YWRtaW46eFRQeUJ5c3hEckhkY3BNYjE2endiQ2tj'
-H 'cache-control: no-cache'
-H 'postman-token: 8dcfa79a-401a-2c7d-c593-703e683ce785'
-d '{
"user":"admin",
"count": 3,
"delay-delete": true
}'<h3>Parameters</h3>
Just as with WP CLI, you can add the count and delay_delete parameters to your call.
Feel free to file issues and pull requests against the project on Github.
Other plugins for developer tooling.
Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...
Duplicate post, post order, image resize, email via SMTP, admin menu editor, custom css / code, disable gutenb...
Create custom "Shortcodes" easily for HTML, JavaScript, CSS code snippets and use the shortcodes wit...
Add PHP code to your pages and posts easily using shortcodes.
An easy, clean, and simple way to enhance your site with code snippets.