1How do you clean transients and revisions efficiently?
Use WP-CLI commands like `wp transient delete --all` and `wp post delete $(wp post list --post_type='revision' --format=ids)` in cron jobs. Pair with Advanced Database Cleaner to remove orphaned order meta, sessions, and logs. Schedule weekly tasks and log results.
Tag cleanup jobs with transaction IDs so you can roll back if a plugin relied on a custom transient.
2How should you index large catalogs?
Add indexes to `postmeta` keys frequently queried (e.g., `_price`, `_stock_status`). Use tools like Index WP MySQL For Speed or manual ALTER TABLE statements. Evaluate query plans with `EXPLAIN` before and after changes to confirm improvements.
Document every custom index and revisit quarterly to ensure it is still used.
3How do you optimize queries for variable products?
Cache variation data, limit `WP_Query` results with specific tax meta, and leverage WooCommerce data stores. Avoid nested meta queries when possible. For complex filtering, offload search to Elasticsearch or OpenSearch.
Enable WooCommerce’s Lookup Tables for attributes; they dramatically speed up layered navigation.
4What backup strategy works for scaling stores?
Use UpdraftPlus, BlogVault, or server snapshots for automated daily backups plus hourly database increments during peak sales. Store copies in multiple regions (S3, Backblaze). Test restores monthly on staging to ensure backups are valid.
Encrypt backup archives and rotate credentials when staff changes to meet compliance requirements.
5How do you monitor database bloat?
Track table sizes via Advanced Database Cleaner or custom Grafana dashboards. Alert when `wp_options` autoload exceeds thresholds or when `wc_order_stats` grows faster than expected. Pair Query Monitor with New Relic to catch slow database calls in real time.
Visualize growth trends so you can predict when to scale hosting tiers before performance drops.
