Hello how I can perform a wordpress installation without the need to create users. I want to just run a command and just install the database. I want the user to get installed via gui when cli install has been completed.

The reason I am asking is because I developed a docker based wordpress solution (https://github.com/ellakcy/wordpress-with-plugins) and performs a wordpress installation via wp-cli. But with that requires to provide user credentials for the first wordpress admin user. Not only that also there is somewhere stored in the server the password as plaintext as well (possible security vunlerability)

Not only that when I use this solution usually I create a personal user account with admin rights so that results the user that is created during installation to be actually useless.

So I want to perform all the installation steps via wp-cli EXCEPT the one that creates any user. What I actually want is to setup the database schema.

  • 1
    Now in the world would you be able to access the gui with appropriate permissions to add a user if you haven't already created a user with administrative privileges?
    – Steve
    Jul 1, 2018 at 23:17
  • is not really clear what you are trying to achieve, first you say you don't want to create users and then you want to "install" a user after install? O_o
    – majick
    Jul 2, 2018 at 2:32

1 Answer 1


It is not possible to install WordPress without creating a user. However, you could immediately remove that user with a second wp-cli command like

yes | wp user delete 1

Note: this will also delete any posts and pages associated with that user. You can normally re-assign them to a different user but in this case, there won't be one.

  • So I have somehow to check if there is already at lease on admin user if exists then delete the admin user that have been generated during installation right? Jul 17, 2018 at 13:09
  • 1
    If you have just created the WordPress install, you could take it for granted that the user exists (given that it has to be this way). However, you can also run wp user get 1 and if the user doesn't exist, $? will equal 1. It will return 0 if the user does exist (shell returns are 0 == ok, non-zero == error) Jul 19, 2018 at 9:42
  • Usually during installation there the user name can be defined as enviromental variable so I can use that as user identifier. Jul 19, 2018 at 10:23
  • Yes, that will work too. Jul 20, 2018 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.