WP-CLI is the official command-line interface for WordPress. Once you learn it you will never want to use the admin panel for server tasks again.
Install WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
wp --info
Core Management
wp core version
wp core update && wp core update-db
Plugin Management
wp plugin list
wp plugin install wordfence --activate
wp plugin update --all
wp plugin deactivate --all
Database Operations
wp search-replace 'http://oldsite.com' 'https://newsite.com' --all-tables
wp db export backup.sql
wp db import backup.sql
wp db optimize
User Management
wp user create newadmin [email protected] --role=administrator --user_pass=SecurePass
wp user update admin --user_pass=NewSecurePass
Conclusion
WP-CLI is essential for efficient WordPress server management. Our team uses WP-CLI for all WordPress deployments and maintenance.
Comments