
Embedding YouTube videos one by one works for two or three clips. For a channel, a course or a portfolio of 40 videos you want a gallery: a tidy grid of thumbnails that opens each video in a lightbox. Here are the two ways to build one in WordPress.
Two approaches
- A gallery fed by YouTube: point the gallery at a channel or playlist and it fills itself. New uploads appear without editing the page. Best for channels, courses and series.
- Videos attached to photos: a normal photo gallery where some tiles open a video. Best for portfolios that mix stills and clips, or for videos from several platforms.
Robo Gallery does both. The YouTube gallery type is in the free version for individual videos; channels, playlists and Shorts are part of PRO.
Option 1: the YouTube gallery type
- Get a YouTube Data API key in the Google Cloud console (create a project, enable YouTube Data API v3, create an API key). Paste it in Robo Gallery → Settings → Youtube API.
- Click Add New Gallery, choose YouTube as the gallery type and create it.
- In YouTube Gallery Settings pick the content mode:
- Channel: enter the channel ID; the gallery loads the channel's videos.
- Playlist: enter the playlist ID (the part after
list=in the playlist URL). - Videos by ID: list the video IDs you want, one per line, in the order you want them.
- Save and place the gallery with the block, the Elementor widget or the shortcode.
Restrict the API key to the YouTube Data API in the Google console, so a leaked key cannot be used for anything else.
Option 2: videos inside a photo gallery
- Create a gallery of any type and open the Media Manager.
- Select an image and paste the video URL into its Video field.
- Save. Clicking that tile now opens the video in the lightbox; other tiles still open photos.
Classic gallery types accept YouTube and Vimeo links. v5 galleries also accept Facebook, Twitch, SoundCloud and Wistia. Use a still from the video, or a better photo, as the tile image: it is what people decide to click on.
Tips for video galleries
- Thumbnails sell the click. YouTube's automatic frames are often blurry mid-sentence stills. For hand-picked galleries use custom thumbnails.
- Keep it fast. A gallery that loads 40 YouTube players at once is heavy. Galleries that show thumbnails and load the player only in the lightbox stay light.
- Group long series. For a course with modules, make one gallery per module and put them in an album.
- Check privacy rules. In the EU, YouTube embeds may set cookies. Mention them in your cookie policy.