I have a wordpress site (6.2.2). I forget my admin password. The site is not setup with SMTP yet, so the forget password link won't work.
I tried several ways, but none of them works.
1. WP CLI - No luck
- Install WP CLI, go to wordpress site folder, 'wp user list' to see all users so I can have my id, then run
wp user update 1 --user_pass=my_clear_password
successfully -> then try to login into the WP admin using 'my_clear_password', but the login failed.
2. Add reset password function call to functions.php: No luck
wp_set_password( 'my_clear_password', 1 );
3. use WP CLI to disable Wordfence, then login again -> No luck
4. Use SQL Update: No luck
UPDATE wp_users SET user_pass=MD5('my_clear_password') WHERE ID=1;
5. My environments:
Ubuntu 22, Wordpress 6.22, MySQL 8, PHP 8.
I am thinking something blocked the logins. Any comments? Thanks!
12
instead of1
; is that a typo? (Also, when resetting with MySQL, use an MD5 hash instead of a cleartext password; see the documentation here.)