Skip to main content
1 of 4
Brooke.
  • 3.9k
  • 1
  • 26
  • 34

Here are 3 ways to do it

  1. Use the wp_signon hook

    $creds = array();
    $creds['user_login'] = 'example';
    $creds['user_password'] = 'plaintextpw';
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    if ( is_wp_error($user) )
    echo $user->get_error_message();

  2. Use jQuery Val and add it to your login page

    $("#user_login").val('username');
    $("#user_pass").val('password');

  3. Modify wp-login.php (Note, this is not recommended although it would work)

Brooke.
  • 3.9k
  • 1
  • 26
  • 34