One WP-CLI command that I’ve found handy is this db-size command. It allows you to output a site’s registered database tables along with the data and index size in any format that WP-CLI natively supports, with multiple sort options: Here’s some example output from one of my test sites: Enjoy!
If for some reason you can’t run wp db query, but need to export SQL output to a CSV or other file, then have a look at this small WP-CLI command I whipped up that should allow this:
I was recently working on an issue that required me to dig through gigabytes of CSV files to look for patterns and data points. I had no intention of bringing all of this data in to Excel, because there’s not enough RAM on earth for that to work. Instead I thought it would be easier […]
Have you ever accidentally saved the same post meta to a post in WordPress, and ended up with a duplicate? Of course, you could go through each post and check the meta, check for duplicates, and delete any of them but… I think I’ve figured out a beast of an SQL query that will give […]