Tag: WP-CLI

  • Gathering database performance with WP-CLI

    Gathering database performance with WP-CLI

    Discover 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

    Getting WordPress Database Size via WP-CLI

    A 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

    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

    Deleting Old Post Revisions in WordPress with WP-CLI

    Working 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

    Disabling WordPress Faux Cron

    Learn 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.