Top 10 Pro includes a full WP-CLI command suite so you can manage counts, database tables, cache, settings, and cron jobs directly from the terminal — without touching the WordPress admin.
All commands start with wp top10. Run any command with --help to see its full option list.
Requirements
- Top 10 Pro must be active (WP-CLI commands are a Pro-only feature).
- WP-CLIOpens in a new window installed and configured for your WordPress site.
Quick reference
| Command group | What it does |
|---|---|
wp top10 cache | Manage the output cache |
wp top10 counts | View, set, reset, export, and import view counts |
wp top10 cron | Manage scheduled cron jobs |
wp top10 db | Database table management |
wp top10 popular | List popular posts |
wp top10 settings | Read, write, export, import, and copy plugin settings |
wp top10 status | Plugin overview: versions, tracker, cron, tables |
Common flags
These flags work across most commands.
| Flag | Description |
|---|---|
--dry-run | Show what would happen without making any changes. Always safe to run. |
--force | Skip the interactive confirmation prompt on destructive commands. |
--network | Run the command for every site in a WordPress multisite network. |
--blog-id=<id> | Target a specific site in a multisite network. |
--format=<format> | Output format: table (default), json, csv, yaml, ids, count. |
wp top10 cache
status
Shows whether the cache is enabled, the cache TTL, and the number of active cache keys.
enable / disable
flush
wp top10 counts
view — list posts with counts
get — get the count for one post
set — overwrite the count for one post
Only applies to the overall table.
reset — delete counts
--table accepts overall, daily, or all (default).
export — write counts to a CSV file
The CSV format is compatible with the admin Import/Export page.
The default file name is tptn-counts-{timestamp}.csv in the current directory. Files may only be written to the WordPress root, the uploads directory, or the system temp directory.
import — load counts from a CSV file
The file must use the same column layout produced by counts export (or the admin export page). The table type — overall or daily — is auto-detected from the header row.
| Option | Default | Description |
|---|---|---|
--table=<table> | auto | Override table detection: overall or daily. |
--mode=<mode> | add | add increments existing counts; set overwrites them. |
--use-urls | — | Resolve the URL column to a post ID instead of using the Post ID column. |
--batch-size=<n> | 1000 | Rows processed per database batch. |
wp top10 cron
status
Shows the next scheduled run time for both the maintenance and aggregation cron jobs.
enable
disable
run — trigger a cron job immediately
The job must already be scheduled. Useful for testing or flushing a backlog.
wp top10 db
status — show table info
aggregate — drain the visits funnel immediately
The aggregation cron normally runs every 2 minutes. Use this to force an immediate run.
cleanup-orphans — remove counts for deleted posts
Count rows that reference posts no longer in the database are removed. On multisite, only rows for the current site are affected.
create-tables — create any missing tables
Safe to run on an existing install; uses dbDelta so it will not destroy data.
prune — delete old rows
Removes rows older than the configured retention period. Default: 180 days for the daily table, 30 days for the visits log.
--table accepts daily, log, or all (default).
recreate-tables — drop and rebuild a table
Creates a backup table before dropping by default. Use --no-backup to skip. Each table’s data is preserved by copying it to a temporary table before the drop and restoring it afterwards.
--table accepts overall, daily, funnel, log, or all (default).
rollup — combine old hourly records into daily totals
Combines daily-table rows older than the given number of days into a single row per post, reducing table size without changing overall view counts. Same operation as the Reduce Daily Table Size tool on the Tools admin screen. Requires the Daily table size reduction feature to be enabled in Top 10 settings.
--before=<days> defaults to 14. Requires --force or --dry-run.
truncate — delete all rows from a table
Destructive. Requires --force or --dry-run.
--table accepts overall, daily, log, funnel, or all (default).
update-tables — apply pending schema upgrades
Runs the same upgrade routine as plugin activation.
wp top10 popular
Lists the most-viewed posts using the same query the plugin uses on the front end.
Options
| Option | Default | Description |
|---|---|---|
--limit=<n> | 10 | Number of posts to return. |
--offset=<n> | 0 | Number of posts to skip (for pagination). |
--daily | — | Use the custom period table instead of the overall table. |
--days=<n> | plugin setting | Date range for custom period queries. |
--from-date=<date> | — | Start date for the custom period (YYYY-MM-DD). Only used with --daily. |
--to-date=<date> | — | End date for the custom period (YYYY-MM-DD). Only used with --daily. |
--how-old=<n> | — | Limit to posts published within this many days. |
--post-type=<type> | all public | Post type slug or comma-separated list (e.g. post,page). |
--include-cat-ids=<ids> | — | Comma-separated term_taxonomy_ids to include. |
--exclude-categories=<ids> | — | Comma-separated term_taxonomy_ids to exclude. |
--include-post-ids=<ids> | — | Comma-separated post IDs to force-include at the top of the list. |
--author=<id> | — | Author ID or comma-separated list of author IDs to filter by. |
--blog-id=<id> | current site | Blog ID or comma-separated list of blog IDs (multisite only). |
--format=<format> | table | Output format. Supports table, json, csv, ids, count. |
wp top10 settings
get
set
--type accepts string, int, float, bool, array. Omit it for auto-detection.
export
Writes all settings to a JSON file.
import
copy — copy settings between sites (multisite only)
Copies all Top 10 settings from a source site to one or more destination sites. The source is excluded from the destination list automatically.
Options
| Option | Default | Description |
|---|---|---|
--source=<id> | current site | Blog ID to copy settings from. |
--destination=<id> | — | Blog ID(s), comma-separated, or all for every other site. Required. |
wp top10 status
Shows a snapshot of the plugin: version, DB version, tracker type, cache, cron schedules, and table row counts.



