Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active January 23, 2018 05:38
Show Gist options
  • Save lukecav/66f1039edcd2827fd1bde82dce86a2be to your computer and use it in GitHub Desktop.
Save lukecav/66f1039edcd2827fd1bde82dce86a2be to your computer and use it in GitHub Desktop.
WP-CLI DB performance optimization
wp db size
wp db size --tables
wp transient delete --expired
wp cache flush
wp post delete $(wp post list --post_type='revision' --format=ids)
wp comment delete $(wp comment list --status=spam --format=ids)
wp comment delete $(wp comment list --status=trash --format=ids)
wp db optimize