Skip to content

Instantly share code, notes, and snippets.

@uptimizt
Forked from mizner/WP-CLI-Commands
Created October 26, 2018 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uptimizt/c3f6de62bab4d7ea39065884cc7d689c to your computer and use it in GitHub Desktop.
Save uptimizt/c3f6de62bab4d7ea39065884cc7d689c to your computer and use it in GitHub Desktop.
WP-CLI - Handy Commands
Search and replace
https://wp-cli.org/commands/search-replace/
wp search-replace
wp search-replace 'http://example.dev' 'http://example.com'
Optmize database
https://wp-cli.org/commands/db/optimize/
wp db optimize
Repair database
http://wp-cli.org/commands/db/repair/
wp db repair
WordPress core version
https://wp-cli.org/commands/core/version/
wp core version
wp core install
wp core install --url=<url>
wp core install --admin_user=<username>
wp core install --admin_password=<password>
wp core install --admin_email=<email>
wp core download --latest --force
wp core download --nightly --force
Active plugins
http://wp-cli.org/commands/plugin/list/
wp plugin list
wp plugin list --status=active
Deactivate plugin
http://wp-cli.org/commands/plugin/deactivate/
wp plugin deactivate
wp plugin deactivate hello-dolly
Theme list
http://wp-cli.org/commands/theme/list/
wp theme list --status=active
Activate default theme
http://wp-cli.org/commands/theme/activate/
wp theme activate twentysixteen
Delete comment
http://wp-cli.org/commands/comment/delete/
wp comment delete
wp plugin deactivate --all --skip-theme --skip-plugins
Delete the database in MySQL
https://wp-cli.org/commands/db/drop/
wp db drop
List the MySQL database tables
https://wp-cli.org/commands/db/tables/
wp db tables
wp db export --tables=$(wp db tables --url=subdomain.example.com --format=csv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment