Skip to content

Use WP-CLI ​

If you manage WordPress from the command line, the show.fm plugin adds wp showfm commands to WP-CLI. Run them in your WordPress folder on the server.

On a multisite network, add --url= with the site's address to every command. Each site connects separately.

CommandWhat it does
wp showfm connectConnects the site to show.fm with a site key.
wp showfm statusShows the connection.
wp showfm syncPicks up episode changes from show.fm now.
wp showfm sync statusShows where the sync is, without contacting show.fm.
wp showfm disconnectDisconnects the site.
wp showfm migrate-embedsSwaps players from other podcast hosts for show.fm blocks.
wp showfm cache flushClears the plugin's cached show and episode data.

Connect ​

  1. In show.fm, open your podcast and go to Podcast Settings → Connected sites.

  2. Under Add a site with WP-CLI, click Create site key.

  3. Enter your current password, choose whether to include transcripts, and click Create site key.

  4. Copy the key. This is the only time you'll see this key.

  5. On the server, run the command (show.fm's Copy command copies it):

    sh
    wp showfm connect
  6. Paste the key when asked. In a terminal, the command asks with the input hidden, so the key stays out of your shell history.

The key connects that one show, and must be used within 24 hours. The site must use https, be reachable on the internet and have the plugin active, because show.fm checks with the plugin before it accepts the key. If the site was already connected, that connection stays until the new one succeeds.

Other ways to give the key, for scripts or anywhere without a terminal:

  • Set the SHOWFM_KEY environment variable, then run wp showfm connect. The command uses it and doesn't ask.
  • Pipe it in with --key=-, for example from a password manager: pass show showfm/site-key | wp showfm connect --key=-.
  • --key=YOUR_SITE_KEY also works, but the key then stays in your shell history and shows in the process list, so the command warns you. Prefer one of the ways above.

Check the connection ​

sh
wp showfm status

It shows the connection's state, the key's last four characters, when the key expires, and when the site last synced and was last pinged by show.fm.

Sync now ​

The site checks for changes every 15 minutes, and straight away when show.fm pings it. To check now:

sh
wp showfm sync
OptionWhat it does
--dry-runShows the next page of changes (up to 20) without applying them.
--from-startGoes through every change from the beginning. Existing posts are kept, and edits made in WordPress stay protected.

To see the sync's position, pending reports and recent problems without contacting show.fm:

sh
wp showfm sync status

Disconnect ​

sh
wp showfm disconnect

Add --yes to skip the confirmation.

The command asks show.fm to cancel the site's key, then removes the key from the site and stops its scheduled syncs, whatever show.fm answers. If show.fm didn't confirm, the command says so and links to Connected sites in show.fm, where you can disconnect the site yourself. Posts the site already made stay.

Clear the cache ​

Players, lists and the block editor's show and episode lookups read a copy of show.fm's data that the plugin keeps on your site and refreshes in the background. To throw that copy away, for example after fixing an episode's details in show.fm:

sh
wp showfm cache flush

Pages keep showing each block's saved copy until the background refresh fetches the data again. Nothing else in WordPress's cache is touched.

On a multisite network, add --network to clear the cache on every site. On a single site, --network is refused.

Migrate embeds ​

wp showfm migrate-embeds runs the same migration as the Migrate tab. It needs a connected site, and an administrator passed with --user=.

  1. Run a dry run, which scans and reports without changing anything:

    sh
    wp showfm migrate-embeds --dry-run --user=admin
  2. Read the table. Each player has its post, host, status, how it matched and its candidate episodes.

  3. Apply the dry run you just read:

    sh
    wp showfm migrate-embeds --resume --yes --user=admin

--yes applies only the saved dry run. It never scans again, so run a new dry run after you change anything.

OptionWhat it does
--dry-runScans and reports without changing posts. It always wins, even with --yes.
--yesSwaps the matched players, and any you chose with --choose. Needs a completed dry run.
--resumeCarries on a scan that stopped, or applies the completed dry run.
--post=<id>Scans only this published post or page.
--choose=<choices>Picks episodes for players that need a choice, as post:embed:episode with the post ID, the player's number in that post (from 1) and the episode ID. Separate several with commas.
--batches=<number>Stops after this many batches of 50 posts. Carry on with --resume.
--resetThrows away a scan that stopped part way, without contacting show.fm. Use it alone, or with --dry-run to start afresh.
--format=<format>table (the default) or json.

For example, to pick episode 11111111-2222-4333-8444-555555555555 for the first player in post 42:

sh
wp showfm migrate-embeds --yes --resume --choose=42:1:11111111-2222-4333-8444-555555555555 --user=admin

If show.fm is busy or can't be reached, the scan keeps what it already has. Run --dry-run --resume to carry on later. While another administrator is running a migration in the Migrate tab, the command refuses to change anything. Try again when they finish.

Was this page helpful?