Use wp-cli for Added Options
The wp-cli utility allows you to do many things WP-related when logged into the command line:
-
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
-
Download and install wp-cli (you’ll get Composer, too):
curl http://modx.co/scripts/install.sh | sh
-
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
- 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
- You can use wp-cli to add admin users to your installation:
You can also add the --user_pass= option to specify a password.wp user create <user-name> <user-email> --role=administrator
-
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
- When moving to a new domain or migrating to a new Cloud, you can use the search and replace function of wp-cli to change the URLS:
wp search-replace 'http://example.test' 'http://example.com' --skip-columns=guid
- To update the home and site URLs:
wp option update home 'http://example.com' wp option update siteurl 'http://example.com'
Explore all the options for WP CLI at https://wp-cli.org/.