Using wp-cli to add users to WordPress and more…

Use wp-cli for Added Options

The wp-cli utility allows you to do many things WP-related when logged into the command line:

  1. Open your terminal, shell or Putty to login via ssh into your new Flex Cloud instance and change directories into your web root:

    cd www
  2. Download and install wp-cli (you’ll get Composer, too):

    curl http://modx.co/scripts/install.sh | sh
    
  3. Update your SSH environment to use the new wp-cli commands (where cXXXX = your instance ID) as shown in the last bold line after running the above:

    source /paas/cXXXX/.profile
    
  4. Edit your WP config file to make sure the DB connection is set to 127.0.0.1 instead of localhost:
    nano wp-config.php
  5. You can use wp-cli to add admin users to your installation:
    wp user create <user-name> <user-email> --role=administrator
    You can also add the --user_pass= option to specify a password.
  6. You further use wp-cli to install caching and SEO plugins that most WP sites should use, like W3 Total Cache, Yoast SEO, Login Lockdown, WP Mail SMTP (so you can use an ESP for better email deliverability) and Export Plus (for easier migrations to Revo!):

    wp plugin install w3-total-cache
    wp plugin install wordpress-seo
    wp plugin install login-lockdown
    wp plugin install wp-mail-smtp
    wp plugin install export-plus
     

Explore all the options for WP CLI at https://wp-cli.org/

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.