How to change WordPress admin email address without admin password
People who use a lot of login credentials may find it difficult to remember all the passwords. In such cases it may be difficult and time consuming to recollect password. There is an option to change the admin password in WordPress via email id. Sometimes it is possible to forget email id as well or that email id doesn’t exist at the moment. In such a case we can view or change the email address form WordPress database
First, you need to login to the database:
[root@web1 ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 656
Server version: 10.2.34-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
To select a database, use the below command:
MariaDB [(none)]> use sf_db
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
WordPress user credentials are stored in the table wp_users, user name is inside user_login column and the email id inside the user_email column.
To view the ’email address’ , following command can be used:
MariaDB [sf_db]> select id,user_login,user_email from wp_users;
+----+------------+-------------------------+
| id | user_login | user_email |
+----+------------+-------------------------+
| 2 | admin | john@sysadminforest.com |
+----+------------+-------------------------+
1 row in set (0.00 sec)
The WordPress admin email address can be updated using the below command:
MariaDB [sf_db]> UPDATE wp_users set user_email="joseph@sysadminforest.com" where user_email='john@sysadminforest.com';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
To view the updated email address the below command can be used:
MariaDB [sf_db]> select id,user_login,user_email from wp_users;
+----+------------+---------------------------+
| id | user_login | user_email |
+----+------------+---------------------------+
| 2 | admin | joseph@sysadminforest.com |
+----+------------+---------------------------+
1 row in set (0.00 sec)
If you like to change the password of a user, you can use the following article.