If you cannot log in, there are three reliable ways to reset a WordPress admin password. Start with the email method and move down only if it fails.
Reset by Email
- Go to
yourdomain.co.ke/wp-login.php. - Click Lost your password?
- Enter your username or email and follow the reset link.
This fails only if your site cannot send email or you no longer control the address.
Reset via phpMyAdmin
- In cPanel, open phpMyAdmin and select your WordPress database.
- Open the
wp_userstable and click Edit on your user row. - In the
user_passfield, type a new password and set the Function column toMD5. - Click Go to save.
WordPress will accept the MD5 value on your next login and upgrade it automatically.
Reset with a Code Snippet
If you have file access but not database access, edit your theme's functions.php and add:
add_action( 'init', function() {
wp_set_password( 'NewStrongPassword123', 1 );
} );
The number 1 is the user ID. Load any page once, then immediately delete this line so the password is not reset on every request.
After regaining access, change the password from Users > Profile to a fresh value.