To quickly add a WordPress user to a site to get access there is a hack possible. This by adding code to theme’s function.php using wp_create_user and set_role

add_action('init', 'add_my_user');
function add_my_user() {
    $username = 'user';
    $email = 'user@site.com';
    $password = 'password';

    $user_id = username_exists( $username );
    if ( !$user_id && email_exists($email) == false ) {
        $user_id = wp_create_user( $username, $password, $email );
        if( !is_wp_error($user_id) ) {
            $user = get_user_by( 'id', $user_id );
            $user->set_role( 'administrator' );
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *