WP-CLI Commands
This page covers wp benecaster cache clear, which clears cached feeds from the command line, and wp benecaster references audit, which lists shared references in your reference library. It requires WP-CLI to be installed and a working WordPress installation.
wp benecaster cache clear
Clears the Benecaster feed cache. Equivalent to clicking the admin UI Clear cache buttons at Benecaster → Shows → [Your Show] → Details → Feed Cache, but scriptable and scope-controllable.
Subcommands
# Clear All Cached Feeds on the Site (All Shows, All Tiers).
wp benecaster cache clear
# Clear All Tier Caches for One Show.
wp benecaster cache clear --show=<id>
# Clear the Cache for One Tier on One Show.
wp benecaster cache clear --show=<id> --tier=<slug>
Flags
| Flag | Description |
|---|---|
--show=<id> |
Scope the clear to a specific show. Pass the WordPress post ID of the Benecaster show. |
--tier=<slug> |
Scope the clear to a specific tier slug. Requires --show. |
--yes |
Skip the confirmation prompt. Use in scripts and CI/CD pipelines. |
Output
On success, outputs the count of cache entries cleared:
Cleared 3 feed cache entries.
Or when nothing needed clearing:
No feed cache entries found to clear.
Examples
# Clear Everything — Confirm Interactively.
wp benecaster cache clear
# Clear the Cache for Show ID 42 Without Prompting.
wp benecaster cache clear --show=42 --yes
# Clear Only the "Premium" Tier on Show 42.
wp benecaster cache clear --show=42 --tier=premium --yes
When to Use
- After a WP-CLI batch episode import that bypasses the episode editor
- In a CI/CD deployment step to force a cache flush after content migrations
- Debugging a stale feed when the admin UI isn’t accessible
For programmatic clearing from PHP (mu-plugins, cron jobs, webhooks), use the benecaster_clear_feed_cache action instead.
wp benecaster references audit
Lists the reference library entries cited by more than one episode, so you can confirm each of those episodes meant the same link. It is report-only: it changes nothing.
Use it to check for references merged by mistake. Earlier versions saved two references with the same label but different addresses as one entry, so both episodes linked to the first address. The second address was never kept, so a merge can’t be detected directly — but every merge produced an entry shared by several episodes, and this lists those.
Most rows it lists are correct. Sharing a reference across episodes is what the library is for, and choosing one from the typeahead shares it on purpose. Treat the list as a shortlist to check, not a list of faults. An empty report means nothing is shared, not proof that nothing was ever merged.
Flags
| Flag | Description |
|---|---|
--show=<id> |
Limit the report to one show, by post ID. Default: every show. |
--format=<format> |
table (default), csv, json, yaml or count. The explanatory lines print only with table. |
Output
One row per shared entry: id, show_id, label, url and episode_count.
Examples
# Every shared reference on the install.
wp benecaster references audit
# One show, as CSV.
wp benecaster references audit --show=42 --format=csv
Correcting a merged reference
There is no merge or split command. Open the episode whose address is right and leave it alone. On the other episode, remove the reference and add it again with its own address — that creates a separate entry. See Creating Episodes.
See Also
Need this built rather than just documented? See our services →