wordpress - How to add a user to wp_users table manually and see in wp-admin portal - Stack Overflow

admin2025-04-18  4

We have a user (who had admin access) that can no longer login to wp-admin portal, as he is not in the wp_users table. I tried to add him, but wordpress tells me that the user already exists. I was able to find a reference about him in wp_usermeta table.

What I did was to find out the user ID from wp_usermeta table and manually create an entry in wp_users that matches the metadata in wp_usermeta.

But when I go to wp-admin the user is not there, and when I list the users with wp cli, it is not listing him either.

Is there a way to recover this user manually by adding him back to the database?

If not, I would like to completely purge him from the db, and re-create his username. Would deleting the reference from wp_usermeta be enough or there might stay residues in different tables?

转载请注明原文地址:http://www.anycun.com/QandA/1744926531a89586.html