Skip to main content
Cookbook Maintenance Presto Player

Replace an Old Video on Every Page at Once with Presto Player and AI

One Presto Player video switched to a new YouTube or Vimeo video, on every page that shows it.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running a recent Presto Player (tested on 4.5.6, free) on WordPress 6.9 or newer, with an administrator account, and Enable AI access and Allow AI to make changes turned on in Presto Player, Settings, AI Abilities and MCP.

The prompt
My WordPress site uses Presto Player. Replace my video [current video title] with [new YouTube or Vimeo link] everywhere it is shown.

1. Run discover_abilities with category presto-player. If presto-player/list-videos, presto-player/get-video, presto-player/chapters-list, presto-player/update-video and presto-player/chapters-save are not there: if no presto-player abilities show at all, tell me to install or update the free Presto Player plugin (its AI abilities need WordPress 6.9 or newer) and to turn on Enable AI access in Presto Player, Settings, AI Abilities and MCP; if only the read abilities show (such as presto-player/list-videos), tell me to turn on Allow AI to make changes there too. Then stop.
2. Run presto-player/list-videos with search set to words from the video's title and per_page 50. If several match, show them with title, type and src and ask which one. If none match, run it again without search and show me the list. Note its video_id and post_id. If its post_id is 0 or its shortcode is empty, tell me the video has no Media Hub post, usually because it was placed directly on a page, so these abilities can't change it (edit it on that page instead), and stop. Run presto-player/get-video with the video_id and note its type, src, external_id and attachment_id. If shares_post_with is not empty, tell me other Media Hub videos use the same post, so changing it would rebuild their player too, and stop. Run presto-player/chapters-list with the video_id and note its chapters.
3. Find where the video is shown: run rest_api GET /wp/v2/pages and GET /wp/v2/posts, each with search presto, status publish,draft,private,pending,future, context edit, per_page 100 and _fields id,title,status,link,content.raw (if 100 come back, ask for page 2; if an answer is cut short, ask again with per_page 20 and page through, or with max_length 100000). A post shows the video when its content.raw has a Presto block presto-player/reusable-display with "id":POST_ID, or a presto_player shortcode with id set to POST_ID. This does not see videos on other content types, such as courses or products, or placed with a page builder widget, a theme template or a sidebar widget. Tell me where it is shown, and that visitors on any published one see the new video as soon as it is saved.
4. Work out the new source. YouTube: type youtube, src the link, and external_id the video ID (the 11 characters after v=, youtu.be/, shorts/, live/ or embed/). Vimeo: type vimeo, src the link, and external_id the number right after video/ when the link has one, otherwise the first number after vimeo.com/ (not a private link's second code). If I gave a file or anything other than a YouTube or Vimeo link, tell me this recipe switches to YouTube or Vimeo only, because a file renames the video and its page, and to switch to a file in the Media Hub, and stop. Always send external_id with a YouTube or Vimeo link: without it, Presto keeps playing the old video. Show me the old and new source side by side. If the type stays the same, tell me its chapters (if any) and any custom poster stay and may not fit the new video (change the poster in the Media Hub), and ask whether to keep or clear the chapters. If the type changes, tell me Presto rebuilds the player: its chapters and poster are dropped and its player preset goes back to the site's default; ask whether to save the old chapters again afterwards. Wait for my yes.
5. Run presto-player/update-video once with the video_id, type, src and external_id. Do not send title, tags or update_slug: changing the title also renames the video's page, and update_slug moves its address. If I asked to clear the chapters, run presto-player/chapters-save with the video_id and chapters set to an empty list. If the type changed and I want the old chapters back, run presto-player/chapters-save with the video_id and the old chapters.
6. Run presto-player/get-video again and confirm type and external_id read back as sent, and src too unless the old video was a file: then src keeps showing the file's address, while the pages play the new video. Run presto-player/chapters-list and tell me the chapters it has now. Give me the sentence to put it back, with the real values: Set the Presto Player video VIDEO_ID back to type OLD_TYPE, src OLD_SRC and external_id OLD_EXTERNAL_ID (or attachment_id OLD_ATTACHMENT_ID) with presto-player/update-video, then save these chapters with presto-player/chapters-save: OLD_CHAPTERS (leave out the last part if it had none). If the type changed, add that the old preset and poster must be set again in the Media Hub.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Replace an Old Video on Every Page at Once with Presto Player and AI” recipe from the WPVibe cookbook on my connected site.

You recorded a better product demo, a new welcome video or an updated tutorial, put it on YouTube or Vimeo, and the old one is on a dozen pages. Finding each page and swapping the embed by hand takes an afternoon, and one page always gets missed.

When the pages use a Presto Player video from the Media Hub, the AI changes the video once and every page that shows it plays the new one. It shows you where the video is shown and what will change, switches the source after your yes, reads it back and gives you one sentence to put the old video back.

The switch is live at once on every published page, so the AI asks first. Within the same service, such as one YouTube video for another, the video keeps its chapters, poster and player settings, and the AI asks whether the chapters still fit. Switching services, such as YouTube to Vimeo or a file to YouTube, rebuilds the player: its chapters and poster are dropped and its preset goes back to your default, so the AI saves the chapters again if you want them. The recipe switches to YouTube or Vimeo only: a file brings its own title along, so switch to a file in the Media Hub. Pages that embed the video directly, without the Media Hub, are not changed. To check your videos first, use this recipe.

Outcome

Every page that showed the old video plays the new one, and you have the sentence that puts the old one back.