How to install and use WP-CLI
Step 1: Download WP-CLI
cd /tmp
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.pharStep 2: Make it executable and move it to PATH
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wpwp --infoStep 3: Install WordPress (if not already installed)
cd /var/www/example.com/html
wp core downloadwp config create --dbname=mydb --dbuser=myuser --dbpass=mypassword --dbhost=localhostStep 4: Manage plugins
Step 5: Manage themes
Step 6: Manage users
Step 7: Update WordPress core
Step 8: Useful WP-CLI commands for everyday work
Command
What it does
Step 9: Set up cron for WordPress
Step 10: Keep WP-CLI updated
Common tasks by example
Common issues
Security tips
Conclusion
Last updated