Want to display your YouTube RSS feed (channel or playlist) on your Joomla site without complex plugins or GDPR woes? This lightweight hack uses Joomla’s com_newsfeeds component, a simple template override, and my free Content - YouTube (No Cookies) plugin to create a privacy-friendly, cached video gallery that updates itself. Drop in the files, set it, and forget it—your YouTube videos stay fresh with zero maintenance!
It's a well kept secret that I'm about to tell you - YouTube publishes RSS feeds for BOTH channels and playlists. I haven't met anyone who uses this, or seen it in use in the wild! I've been holding onto this knowledge for a long time, and just recently did I find a reason to use it. Of course, spending the time solving problems means making it easy for everyone else...at least that's how I feel about it.
Why This Is Awesome
- Set-and-Forget: Joomla caches the YouTube RSS feed, so videos load fast and update automatically when the cache expires.
- Privacy-Safe: Uses youtube-nocookie.com iframes to avoid tracking cookies, keeping it GDPR-compliant.
- No Bloat: Just two override files and a free plugin—no heavy extensions needed.
What You’ll Need
- Joomla 4.x through 6.x (tested on both).
- Content - YouTube (No Cookies) plugin (free, as always!).
- A YouTube RSS feed URL
- Channels: https://www.youtube.com/feeds/videos.xml?channel_id=[CHANNEL_ID]
- Playlists: https://www.youtube.com/feeds/videos.xml?playlist_id=[PLAYLIST_ID])
You can find the channel RSS feed in the source of your main channel page. The playlist ID is in the URL of the playlist you want to feature.
How the YouTube RSS Feed Gallery Works
Joomla’s com_newsfeeds component fetches a YouTube RSS feed, parsing video titles, URLs (e.g., https://www.youtube.com/watch?v=abc123), and descriptions into a tidy array. We override the default newsfeed view with two files:
- default.php: handles an output override bug in Joomla that I will be addressing shortly
- youtube.php: loops through the feed items integrating with the Content - YouTube (No Cookies) plugin.
The plugin provides CSS (video thumbnail, play button overlays) and JS (lazyloading, click-to-play logic). Joomla’s caching ensures lightning-fast loads and auto-updates when new videos hit the channel or playlist.
Setup Instructions
- Configure the Newsfeed:
- Go to Components → Newsfeeds → New.
- Add a name (e.g., “My YouTube Channel”).
- Enter your YouTube RSS feed URL (find your channel/playlist ID on YouTube, then use https://www.youtube.com/feeds/videos.xml?channel_id=[ID] or ?playlist_id=[ID]).
- Save and create a menu item (Menu Item Type: Newsfeeds → Single Newsfeed).
- Install the Plugin:
- Grab Content - YouTube (No Cookies) (free download).
- Install via Extensions → Manage → Install.
- Enable in Extensions → Plugins (no extra config needed—it auto-detects YouTube embeds).
- Add the Template Override:
- Download the zip file: youtube-feed.zip
- Unzip to templates/[your-template]/html/. It includes a directory structure (com_newsfeeds/newsfeed) with the following files:
- default.php: override hack to fix a Joomla bug.
- youtube.php: Renders video items with plugin-powered lazyloading.
- Ensure the folder structure matches: templates/[your-template]/html/com_newsfeeds/newsfeed/.
- Test It Out:
- Visit your newsfeed menu item. Expect a responsive grid of YouTube thumbnails with play buttons.
- Click once to load a no-cookies iframe, click again to play.
- Tweak cache time in newsfeed settings if updates are too slow or frequent.
Tips and Tricks
- Cache Settings: Use 900 seconds for channels with daily uploads, 3600 for weekly. Find it in Components → Newsfeeds → Edit → Cache Time.
- Thumbnail Sizes: The override uses hqdefault.jpg for crisp thumbnails. Swap to mqdefault.jpg for smaller files or maxresdefault.jpg for high-res in youtube.php.
- Styling: The plugin’s CSS handles the responsive grid and play buttons. Customize in your template’s CSS if needed (e.g., .ytnc-preview for thumbnail containers).
- Override Issues: If the override doesn’t load, verify the path and clear Joomla’s cache (System → Clear Cache). I’m working on a Joomla GitHub pull request to fix com_newsfeeds override quirks—watch my GitHub for updates!
Troubleshooting
- Thumbnails Missing? Check the RSS feed URL. Ensure the channel/playlist ID is correct and the feed is public
Why I Love the YouTube RSS Feed
This started as a “dumb idea” for a client who wanted their YouTube videos on their Joomla site. Knowing YouTube’s RSS feeds exist, I hacked it together with com_newsfeeds and my no-cookies plugin. The result? A lightweight, auto-updating video gallery that respects user privacy and requires zero upkeep.
The template override I've provided is rudimentary, and certainly could use some flair. I'm not generally the flare guy - I'm the data guy - so I present it to you in its raw form and let you style to your liking.
Demo? But Of Course!
I whipped up both a channel example, and a playlist example.
- Channel: Basic Joomla Tutorials
- Feed derived from this page: https://www.youtube.com/@Basicjoomla
- Playlist: Rush 40th Anniversary Signals Playlist
- Feed derived from this page: https://www.youtube.com/feeds/videos.xml?playlist_id=PLyzOXHX-1l7dM1mBUWtSK5sz4P5Wzupm