Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save omurphy27/01b34452f57c5e18cbf7 to your computer and use it in GitHub Desktop.

Select an option

Save omurphy27/01b34452f57c5e18cbf7 to your computer and use it in GitHub Desktop.
create wordpress wp admin account through ftp - reset password.php
// create Wordpress admin account through FTP
//http://forrst.com/posts/Create_New_Admin_Account_in_WordPress_via_FTP-NOF
function add_admin_acct(){
$login = 'myacct1';
$passw = 'mypass1';
$email = '[email protected]';
if ( ! username_exists( $login ) && ! email_exists( $email ) ) {
$user_id = wp_create_user( $login, $passw, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
}
add_action( 'init', 'add_admin_acct' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment