How to Reset Your WordPress Admin Password Print

  • 0

If you’ve forgotten your WordPress admin password, here’s how to reset it:

  1. Use the "Lost Your Password?" Feature:
    • Go to your WordPress login page (e.g., yourdomain.com/wp-login.php).
    • Click Lost your password? below the login form.
    • Enter your admin email address and check your email for a reset link.
  2. Reset via phpMyAdmin:
    • If you can’t access your email, you can reset the password directly in the database using phpMyAdmin.
      1. Log in to cPanel and click phpMyAdmin under the Databases section.
      2. Select your WordPress database.
      3. Go to the wp_users table and find the admin account.
      4. Click Edit next to the admin username.
      5. In the user_pass field, select MD5 from the function dropdown, and enter your new password.
      6. Click Go to save the changes.
  3. Use FTP to Add a Temporary User:
    • You can also add a new admin user via FTP by adding code to your functions.php file:
      1. Access your theme’s folder via FTP: wp-content/themes/yourtheme/.
      2. Edit functions.php and add this code:
        php
        function admin_account(){
        $user = 'newadmin';
        $pass = 'password123';
        $email = 'email@example.com';
        if ( !username_exists( $user ) ) {
        $user_id = wp_create_user( $user, $pass, $email );
        $user = new WP_User( $user_id );
        $user->set_role( 'administrator' );
        }
        }
        add_action('init','admin_account');
      3. Log in using the new credentials, then remove the code from functions.php.

Was this answer helpful?

« Back