Tag: WP-CLI
-
Gathering database performance with WP-CLI
in WordPressDiscover how we employed WP-CLI to streamline the assessment of database server performance in WordPress, facilitating a more efficient profiling of SQL queries before and after crucial server upgrades.
-
Getting WordPress Database Size via WP-CLI
in WordPressA WordPress WP-CLI command `db-size` allows fetching database tables, their data, and index size in various formats. The command offers sorting options like total, table, data size, and index size. Use `–format` to adjust the output format (`table`, `csv`, `json`, `count`, `yaml`), and `–raw` for full byte size.
-
Quick Tip: Export WordPress SQL output via WP-CLI
Learn how to run custom SQL queries on your WordPress database using a small WP-CLI command. The command supports different output formats like table, CSV, JSON, and more. Plus, it includes a dry run option for safety. No need to rely on `wp db query` anymore!
-
Deleting Old Post Revisions in WordPress with WP-CLI
in WordPressWorking with a client’s large database, I crafted a custom WP-CLI command to purge post revisions based on specific criteria, saving backups of those deleted. This script efficiently prunes revisions older than a year and prior to post publication, reducing the overall database size prior to a site migration.
-
Disabling WordPress Faux Cron
in WordPressLearn about the WordPress WP-Cron system, its flaws, and how to fix them. Disable the default cron behavior and switch to a system cron for better performance. Improve site speed by managing cron events efficiently to avoid slowdowns on frontend requests. Let a system cron handle periodic tasks effectively for optimal site maintenance.
-
Validating WordPress attachments with WP-CLI
in developmentI recently worked on migrating a site to a different server and for one reason or another, some of the images did not come over properly. While I could have just re-downloaded and re-imported all of the media, it would have taken quite a while since the media library was well over 100Gb. Instead, I…