Using WordPress CLI

Published on Author admin

Using WordPress CLI for managing WordPress instance.

Download WordPress CLI:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Check it:

php wp-cli.phar --info

Make it executable:

chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

Check it:

wp --info

Update WP CLI tool:

wp cli update

Upgrade WordPress using WP CLI:

sudo -u apache /usr/local/bin/wp core update --path=/path/to/wordpress/

List WordPress plugins:

sudo -u apache /usr/local/bin/wp plugin list --path=/path/to/wordpress/

Upgrade plugin:

sudo -u apache /usr/local/bin/wp plugin update wordpress-seo --path=/path/to/wordpress/

References:
wp-cli
WP-CLI