WP Manifestindependent plugin directory
manifest / media / latest-youtube-playlist-video

Latest YouTube Playlist Video Block

A WordPress block that displays the latest video from a YouTube playlist with no API key required. The thumbnail is saved to the local media library, and results are cached hourly to avoid repeated external fetching.

by david wolfpaw · github.com/davidwolfpaw/latest-youtube-playlist-video

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/davidwolfpaw/latest-youtube-playlist-video/archive/refs/heads/main.zip

A WordPress block that displays the latest video from a YouTube playlist with no API key required. The thumbnail is saved to the local media library, and results are cached hourly to avoid repeated external fetching.

Features

  • Fetches the most recent video from any public YouTube playlist via RSS (no YouTube Data API key needed)
  • Saves the thumbnail to your local media library so no third-party images are served to visitors
  • Responsive image output with WordPress generated srcset and sizes
  • Two layouts: stacked (thumbnail above text) or columns (thumbnail left, text right)
  • Configurable thumbnail resolution, title/excerpt display, typography, and link behavior
  • Results cached with transients; thumbnails stored in the media library

Requirements

  • WordPress 6.0+
  • PHP 8.0+
  • A public YouTube playlist (private playlists are not accessible via RSS)

Installation

  1. Upload the latest-youtube-playlist folder to wp-content/plugins/.
  2. Activate the plugin under Plugins → Installed Plugins.
  3. Add the Latest YouTube Playlist Video block from the block inserter.

Usage

  1. Open the block's Playlist Settings panel in the sidebar.
  2. Paste your YouTube playlist ID — the list= value from the playlist URL (e.g. PLxxxxxxxxxxxxxx).
  3. Adjust layout, thumbnail size, and typography options as needed.

How it works

The plugin reads YouTube's public Atom feed (youtube.com/feeds/videos.xml?playlist_id=…), finds the most recently published entry, and caches the result for one hour. On the first frontend render after a cache miss the thumbnail is sideloaded into your WordPress media library; subsequent renders serve the local copy with a full responsive srcset.

The block editor preview loads the thumbnail directly from YouTube's image CDN for speed. Only the published front-end output uses the local copy.

Caching

Data Storage TTL
Playlist feed (video metadata) Transient 1 hour
Thumbnail attachment ID Transient + media library 1 week

To force a feed refresh, delete the lyp_latest_* transients with a transient-manager plugin or via WP-CLI:

wp transient delete --search="lyp_latest_"

License

GPL-3.0-or-later