WordPress Core Contributor, WordPress Kaunas Meetup co-organizer, WordCamp, WordSesh, TEDx speaker and one of the editors of the Lithuanian WordPress translation team.
Free, premium and custom WordPress plugin developer
Engineering Team Lead at
Any sufficiently advanced technology is indistinguishable from magic
- Arthur C. Clarke,1973
The official command line tool for interacting with and managing your WordPress sites.
Yup, the Terminal.
Official website: https://make.wordpress.org/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 plugin update akismet --version=1.0.0
wp command action input --parameter=value
--path= a path to s WordPress directory
--url= url of the site
--user= set user
--skip-themes[=theme]
--skip-plugins[=plugin]
--dry-run
--format=json|table|csv
https://make.wordpress.org/cli/handbook/config/#global-parameters
wp plugin install tinycoffee
wp plugin activate tinycoffee
wp plugin update tinycoffee --version=0.1.0
wp theme install twentyseventeen
wp theme install twentyseventeen
wp theme update twentyseventeen --version=0.1.0
wp user list
wp user create bob bob@example.com --role=author
wp user update 123 --display_name=Mary --user_pass=marypass
wp config
wp core
wp cache
wp comment
wp cron
wp db
wp export
wp import
wp media
wp menu
wp network
wp option
wp package
wp post
wp post-type
wp profile
wp rewrite
wp role
wp server
wp sidebar
wp search-replace
wp site
wp super-admin
wp taxonomy
wp term
wp transient
wp widget
...
wp core update
wp core update-db
wp core update-db --network
wp core download --locale=lt_LT
wp config create --dbname=testing --dbuser=wp
--dbpass=securepswd
wp core install --url=example.com --title=Example
--admin_user=supervisor --admin_password=strongpassword --admin_email=info@example.com
wp export
wp import example.wordpress.2018-08-10.xml
wp db export backup.sql
wp db import backup.sql
wp search-replace olddomain.com newdomain.com 'wp_post*'
wp db search - another option
https://make.wordpress.org/cli/handbook/references/config/
wp-cli.yaml
wp @prod post list
if ( class_exists( 'WP_CLI' ) ) {
WP_CLI::add_command( 'hello', 'arunas_cli_hello' );
}
function arunas_cli_hello( $args, $options ) {
WP_CLI::success( 'Hello, World!' );
}