Cookbook › WP-CLI
Add up data from a plugin’s own table
Paste into ChatGPT or ClaudeUse WP-CLI to find my form plugin’s entries table, show me its columns, then count this month’s entries per form.
Reads only. Nothing on your site changes, at any safety level.
What happens
Section titled “What happens”- Your assistant runs
wp db tablesandwp db columnsto find the right table and understand it. - It runs one
wp db querywithCOUNTandGROUP BY, up to 1,000 rows. - It reports the totals. Nothing changes.
Try also
Section titled “Try also”- “Join the orders and customers tables and total this month’s sales per country.”
- “Mark entries 120 to 140 as read.” (A change: up to 100 rows, all or nothing.)
Good to know
Section titled “Good to know”- Passwords, keys and AI Puffer’s own tables stay hidden.
- Changing a plugin’s data is possible, up to 100 rows at a time. Keep a backup, and read the plugin’s own docs before you change its tables.