WordPress admin

Need to reset my admin details on wordpress, I have no idea what my admin username or password is; furthermore I don’t have access to phpmyadmin either as I wasn’t the one to set it up. would love some feedback!

Related posts

Leave a Reply

3 comments

  1. You can log in if you have access to the FTP where the site is hosted. If you have access, create a new php-file in the root directory (autologin.php for example), paste the following code and then visit your new file through the browser (link.com/autologin.php for example).

    <?php
    
    require_once('wp-load.php');
    
    auto_login("admin"); //Change this to your username.
    
    function auto_login($username) {
        $user = get_userdatabylogin($username);
        $user_id = $user->ID;
        wp_set_current_user($user_id, $user_login);
        wp_set_auth_cookie($user_id);
        do_action('wp_login', $user_login);
        wp_redirect(admin_url());
    }
    
    ?>
    
  2. You can goto phpMyAdmin
    Under tables goto wp_users
    Then for whichever user you want to edit details click edit
    replace password and change category to MD5