Skip to content

Instantly share code, notes, and snippets.

@sebastianmoran-mainwp
Last active October 26, 2018 15:21
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 sebastianmoran-mainwp/af324dc7633843c733c77077a871f73c to your computer and use it in GitHub Desktop.
Save sebastianmoran-mainwp/af324dc7633843c733c77077a871f73c to your computer and use it in GitHub Desktop.
Common and handy WP-CLI commands
wp plugin list
wp plugin deactivate --all
wp plugin install contact-form-7 --version=5.0.3 --force
wp theme active twentyseventeen
wp theme install astra --active
wp db export
wp db reset --yes
wp db import filename.sql
wp db size
wp db size --tables
wp db optimize
wp search-replace ‘http://example.com’ ‘https://example.com’ --recurse-objects --skip-columns=user_email,guid --all-tables --dry-run
wp search-replace ‘https://example.com’ ‘https://domain.com’ --recurse-objects --skip-columns=user_email,guid --all-tables --dry-run
wp search-replace ‘http://example.com’ ‘https://example.com’ --recurse-objects --skip-columns=user_email,guid --all-tables
wp search-replace ‘https://example.com’ ‘https://domain.com’ --recurse-objects --skip-columns=user_email,guid --all-tables
wp cache flush
wp rewrite flush
wp transient delete --expired
wp transient delete --all
wp option update classic-editor-replace replace --skip-themes --skip-plugins
wp comment delete $(wp comment list --status=spam --format=ids)
wp mainwp sync --all
wp mainwp plugin --upgrade-all
wp mainwp theme --upgrade-all