Home » Shortcodes » How to Display a YouTube Playlist on Your WordPress Website
Welcome to this tutorial! Today, we’ll learn how to display a YouTube playlist on your WordPress website using a shortcode and Elementor. Let’s get started.
How to Display a YouTube Playlist on Your WordPress Website
- First, log in to your WordPress admin dashboard. Once you're logged in, navigate to
Templates→Saved Templates. Select the template where you want to display the YouTube playlist. - Next, click on the
Edit with Elementorbutton for the selected template. This will open the Elementor editor, where you can make visual changes to your page - Now, find the
Shortcodewidget from the Elementor widget library. Drag and drop it to the desired location on your page where you want the YouTube playlist to appear. - Within the Shortcode widget, paste the following shortcode: [qb_youtube_playlist playlist_id="YOUR_PLAYLIST_ID" cols=3]
- Replace
YOUR_PLAYLIST_IDwith the playlist ID of your YouTube channel.
How to find the playlist ID?
- To locate your playlist ID, visit your YouTube channel and click on the
Playliststab. Then, select the playlist whose videos you want to display. - Click on the
View Full Playlistlink or open the playlist in a new window. - In the URL, you’ll see a parameter like this:
list=<YOUR_PLAYLIST_ID>. Copy the value afterlist=– that’s your playlist ID.
YOUR_PLAYLIST_ID in the shortcode with the actual playlist ID you copied. Once done, click the Apply button to save your changes.
Finally, click the Publish button in Elementor to save your updates. Your YouTube playlist will now appear on the page you edited.
The shortcode includes a cols attribute, which defines how many videos to display per row. The default value is 3
You can customize this to display 1, 2, 4, or 6 videos per row by updating the cols attribute in the shortcode. For example:
cols=1will display one video per row.cols=6will display six videos per row.
Apply to see the changes.
And that’s it! You’ve successfully added a YouTube playlist to your WordPress website. Now your visitors can enjoy watching your playlist right from your site.