Create a new WordPress administrator
create wordpress admin without login | locked out of wordpress admin | add admin user wp cli | wp-cli | users | accessCaution: This command changes the system. Understand what it does before you run it.
wp user create emergencyadmin admin@example.com --role=administrator --path=/var/www/vhosts/example.com/httpdocsCreates a new user with the administrator role. Without --user_pass, WP-CLI generates a random password and prints it once in the output. Useful when all admin accounts are lost or locked.
Note: Delete emergency accounts once the work is done (wp user delete emergencyadmin --reassign=1), otherwise they remain a way in for attackers.
Also searched as
- create wordpress admin without login
- locked out of wordpress admin
- add admin user wp cli