Latest YouTube Video Embedder (RSS Version)
Embed the latest YouTube video from a specified channel using a WordPress shortcode.
by Jeremy + Echo · github.com/usd21developers/yt-latest-embed
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/usd21developers/yt-latest-embed/archive/refs/heads/main.zipContributors: merlynx Plugin Name: Latest YouTube Video Embedder Tags: youtube, youtube embed, latest video, playlist, rss, shortcode Requires at least: 4.5 Tested up to: 6.8 Stable tag: 1.4 License: GPLv3 or later
Embed the latest YouTube video from a channel or playlist using a WordPress shortcode — no API key required.
Description
Latest YouTube Video Embedder retrieves the newest public YouTube video without requiring a YouTube Data API key.
The plugin tries YouTube's public RSS feed first. If YouTube's RSS service returns an error, it falls back to the public channel /videos page or playlist page and extracts the newest video ID from YouTube's own rendered page data. The most recent successful video ID is also retained as a last-known-good fallback so a temporary YouTube outage does not blank an existing embed.
Configure your default channel ID and/or playlist ID via Dashboard > Settings > Latest YouTube Video. Use the shortcode [latest_youtube_video] anywhere in posts, pages, or widgets.
Installation
- Download the plugin ZIP file from GitHub Releases.
- In your WordPress admin panel, navigate to
Plugins→Add New. - Click
Upload Pluginand select the downloaded ZIP file. - Activate the plugin after installation.
Usage
- Go to Settings → Latest YouTube Video in your WordPress dashboard.
- Enter your default channel ID and/or playlist ID.
- Use
[latest_youtube_video]to embed the most recent video from the default channel. - Use shortcode attributes to pull from a playlist or override the ID.
Shortcode
Basic shortcode: [latest_youtube_video]
Optional variations: [latest_youtube_video source="channel"] [latest_youtube_video source="playlist"] [latest_youtube_video channel="UCabc123XYZ"] [latest_youtube_video playlist="PLxyz456ABC"]
Parameters
source: Eitherchannelorplaylist. Uses the corresponding default from settings if provided.channel: Overrides the default channel ID inline.playlist: Overrides the default playlist ID inline.
FAQ
Do I need a YouTube API key?
No. The plugin uses public YouTube RSS and public YouTube web pages. It does not call the authenticated YouTube Data API.
What happens if YouTube RSS is unavailable?
The plugin tries the corresponding public YouTube channel or playlist page. If that also fails and the plugin has previously retrieved a valid video for that source, it serves the last known good video instead.
How often does the plugin refresh?
A successful result is cached for one hour. The last known good video is stored separately and retained across transient expiration.
How do I get a channel or playlist ID?
- For channel ID: use YouTube's Copy channel ID option or the
UC...value from the channel URL/source. - For playlist ID: copy the part of the playlist URL after
?list=.
Changelog
1.4 (08/24/2026)
- Keep public RSS as the primary retrieval method
- Fall back to the public YouTube channel
/videospage when channel RSS fails - Fall back to the public YouTube playlist page when playlist RSS fails
- Extract video IDs only from recognized YouTube video renderer structures
- Retain a persistent last-known-good video ID for temporary YouTube outages
- Keep one-hour transient caching and all existing shortcode/settings behavior
- No YouTube API key required
1.3 (08/24/2026)
- Fetch YouTube RSS feeds with
wp_remote_get()for better WordPress and TLS compatibility - Handle WordPress HTTP errors, non-2xx responses, empty responses, and malformed XML
- Prefer the feed's
yt:videoIdvalue with backward-compatible Atom ID parsing - Validate channel and playlist IDs before constructing requests
- Log diagnostic details when
WP_DEBUGis enabled without exposing them to site visitors
1.2 (07/31/2025)
- Fully updated to use public RSS feeds (no API key required)
- Added support for playlist and channel mode
- Admin settings panel for default IDs
- Smart shortcode system with override flexibility
License
GPLv3 or later
Credits
Code collaboration with ChatGPT (Echo) from OpenAI.