//create new Admin User in WordPress
add_action('init','create_new_admin_user');
function create_new_admin_user(){
  $user = 'your username';
  $pass = 'Password';
  $email = 'your email address';
  if ( !username_exists( $user )  && !email_exists( $email ) ) {
  $user_id = wp_create_user( $user, $pass, $email );
  $user = new WP_User( $user_id );
  $user->set_role( 'administrator' );
  }
}

0 Comments

Leave a Comment