Skip to content

Instantly share code, notes, and snippets.

@kulterryan
Last active July 16, 2023 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kulterryan/a67d0656ffabf57d8a35beffbb562aa1 to your computer and use it in GitHub Desktop.
Save kulterryan/a67d0656ffabf57d8a35beffbb562aa1 to your computer and use it in GitHub Desktop.
Set default password for every user in WordPress
<?php
add_action('user_register', 'kr_alter_password', 10, 1);
function kr_alter_password($user_id) {
// user email. $user return full user info
// new entered password (plain text)
if ( $user_id ) {
wp_set_password( "[your-password]", $user_id );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment