Last active
January 23, 2018 05:38
-
-
Save lukecav/66f1039edcd2827fd1bde82dce86a2be to your computer and use it in GitHub Desktop.
WP-CLI DB performance optimization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.wordpress.org/cli/commands/db/size/
https://developer.wordpress.org/cli/commands/db/size/#options
https://guides.wp-bullet.com/automatically-delete-expired-wordpress-transients-using-wp-cli/
https://developer.wordpress.org/cli/commands/transient/
https://developer.wordpress.org/cli/commands/cache/flush/
https://kinsta.com/knowledgebase/wordpress-revisions/
https://developer.wordpress.org/cli/commands/post/delete/
https://developer.wordpress.org/cli/commands/comment/
https://developer.wordpress.org/cli/commands/comment/delete/
https://developer.wordpress.org/cli/commands/db/optimize/