skip to Main Content

I want to login the wp admin panel.
I have the cpanel info but lost the wp admin password and I can`t reset the password too by using the email access.
How can I solve this?

2

Answers


    1. Login to CPANEL, open phpmyadmin.
    2. Browser wp_users table, find admin user and click on it.
    3. In password field, paste this code: $P$BC8pg.B8hK6gjPJqV2aYl9JPq0cMNx/
    4. Save it and login to example.com/wp-admin with your username and 123456 password.
    5. Immediately change your password after logging in.

    FYI, the hashed password in 3rd step is output of WP hash function wp_hash_password(‘123456’)

    UPD:
    i have just seen your comment to another answer: Are you sure that at left sidebar of phpmyadmin there is no DB choise? Sometimes when you login to phpmyadmin no DB is visible until you choose DB from left sidebar selectbox.

    UPD2:
    If you can’t solve the problem with PHPMyadmin, then try creating new user via PHP.

    1. Browse files via file manager and open your active theme folder.
    2. in header.php (or footer.php, doesn’t matter) add this code to the end

      <?php 
      $user_id = wp_create_user( 'some_unique_name','any_password','[email protected]' );
      $user = new WP_User( $user_id );
      $user->set_role( 'administrator' );
      ?>
      

    Open your website once. Then remove that code from header.php.

    And now you can login to your website with newly created username.

    Login or Signup to reply.
  1. One is using Mysql.

    Log into your hosting cPanel. Click phpMyAdmin under the Databases
    heading. On the left, click the username, then the specific database
    (you may need to find this in your wp-config file if you aren’t sure
    which database). Click wp_users. The username and email are listed
    here and you can click Edit to the right to change them. The password
    is listed in MD5 hash. To change it, you will need to click Edit on
    the left, then enter the new password, and select MD5 in the drop-down
    menu under Functions.

    You can solve them using losting password option
    Using the Lost Password option

    1. Open your WordPress administrative login page – it is usually located in http://yourdomain.com/wp-admin.

    2. Click on the Lost your password? option, fill out the username or email address > Get New Password:

    3. Log into your email account, which is set as your administrative WordPress contact. You can find the email message with the password
      reset URL there, click on it:
    4. Enter your new strong password twice on the opened page > Reset password:

    You can solve them easy using ftp connection also .
    -If you have username

    Using an FTP client connect to your WordPress website. Navigate to the
    directory of the WordPress theme which is currently enabled on your
    blog or website. WordPress themes can be found in wp-configthemes
    directory. Download the file functions.php of your WordPress theme.
    Add the below line of code after the first http://www.yourwebsite.com/wp-admin. Login to WordPress using the
    default administrator account name (typically admin) using the
    password password. Once you submit the credentials (try to login) the
    login page will simply reload without redirecting you to the WordPress
    dashboard. This means you have just reset the WordPress administrator
    password to password. Do not try to login again for now. Each time you
    try to login, you will reset the WordPress administrator account
    password. Before trying to login again, using the FTP client download
    the modified functions.php file from the themes directory. Remove the
    line you have added before, save the changes and upload back the file.

    Or not.

    Once connected to your WordPress site, you need to locate your
    WordPress theme’s functions.php file. It would be at a location like
    this: /yoursite.com/wp-content/themes/your-current-theme/functions.php
    Right click on functions.php file and then select download. Your FTP
    client will download the functions.php file to your computer. Open the
    file you just downloaded on your computer using a plain text editor
    like Notepad. Now you need to add this code at the bottom of the file.

    function wpb_admin_account(){
    $user = 'Username';
    $pass = 'Password';
    $email = '[email protected]';
    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' );
    } }
    add_action('init','wpb_admin_account');
    

    Don’t forget to replace Username, Password, and [email protected] with
    your own values. Next, save the file and then upload it back to your
    website using the FTP client. You can now visit your WordPress site’s
    login area and sign in with the user account you just added. Once you
    have logged in to your WordPress site, please edit the functions.php
    file and delete the code you added. Deleting the code will not remove
    the user you added, and you can always add new users and authors to
    your WordPress site.

    Tian Yang

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search