Tutorials WordPress

How to Embed a YouTube Playlist in WordPress

Updated

Written by

Dave Warfel

Reading Time

7 minutes

If you buy something from one of our links, we may earn a commission.

I recently demonstrated 4 different ways to embed a YouTube video in WordPress. Now you might be asking, “How do I embed a YouTube playlist in WordPress?” You’ll be happy to know it’s quite easy, and the process is not that much different from embedding a single video. Let’s take a look.

Animation of a YouTube playlist WordPress embed
Animation of a YouTube playlist embed

There are 4 main ways to embed a YouTube playlist in WordPress:

  1. Using oEmbed (easiest)
  2. Using the embed shortcode (a few more options)
  3. Using an <iframe> (a lot of customization)
  4. In your WordPress sidebar

[adrotate banner=”150″]

Watch the Video

If you’re short for time, check out our video which covers the main ways to embed a YouTube playlist in WordPress.

Getting a YouTube Playlist URL

Before we can embed a YouTube playlist, it’s helpful to know how to get the playlist URL. This is just a little different from getting a video URL.

  • From any page on youtube.com, open the menu from the top-left corner
  • Under Library, click on the playlist you want to embed
YouTube playlist icon in sidebar
The playlist icon in YouTube’s new design (Summer 2017)
  • This will take you to the main playlist page
  • The URL should look like this
https://www.youtube.com/playlist?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G
  • Copy that URL to your clipboard

Alternatively, if you’re watching a video within a playlist, you should see the playlist name on the right side of the screen. Clicking on the playlist name will take you to the same URL.

YouTube playlist name in sidebar

Now we’ll get into the various ways to embed the playlist on your WordPress site.

[thrive_hidden_input_permalink]

01 Easiest Way to Embed a YouTube Playlist in WordPress

The easiest way to embed a YouTube playlist is to simply paste the playlist URL into the visual editor. Make sure you’re using the Visual editor, and not in Text mode.

Then just paste the YouTube URL on it’s own line, and WordPress will automatically add the embed code for the playlist. You should see a preview right there in your visual editor.

YouTube playlist embed in visual editor

This works because of a technology called oEmbed. There are other types of content you can insert into WordPress just by pasting the URL in your post screen. Learn more about WordPress oEmbeds »

02 Embed YouTube Playlist in WordPress using a shortcode

If you’d like to set a maximum width or height on your playlist, you can use the embed shortcode. The instructions are exactly the same as embedding videos, so hop on over to our YouTube video embed tutorial to learn about this method.

03 Embed YouTube Playlist in WordPress using an <iframe>

Using an iframe to embed a YouTube playlist provides you with more flexibility over how the playlist is displayed.

First, I’ll show you how to embed the playlist, and then I’ll explain the available options and how to set them up.

NOTE: This is currently only available in the classic version of the YouTube design. If you’ve enabled the new design, you can access the old version of a playlist by adding &disable_polymer=true to the end of the URL.

How to use the <iframe> method

  • On YouTube.com, navigate to the playlist you want to embed
  • Click on Share
  • Then click on Embed

YouTube playlist embed/share iframe code

  • Clicking Show More will provide you with a few additional options, which we’ll discuss in a moment
  • Copy the <iframe> code
  • Go back to your WordPress editing screen, and click on the Text tab
  • Paste the code on it’s own line, where you want the video to appear

The most basic code will look something like this:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G" frameborder="0" allowfullscreen></iframe>

(Optional) You can remove the width and height parameters to force the playlist to automatically fit inside of its container.

How to customize a YouTube playlist via the URL

Now I’ll show you how to customize the way in which the playlist appears on your site.

Here is a list of URL parameters you can add to the end of the <iframe> src attribute, and what they do:

  • allowfullscreen – This is not a URL parameter, but you remove this attribute from the <iframe> to disable fullscreen mode
  • controls=0 – Hides the player controls (play/pause, volume, captions, settings, fullscreen, etc.) at the bottom
  • showinfo=0 – Hides the playlist title & sharing options at the top
    NOTE: This kind of defeats the purpose of embedding a playlist, because it removes the option to open the playlist up and view all videos.
  • autoplay=1 – Starts playing the 1st video in the playlist automatically, when the page loads
  • loop=1 – As soon as the last video in the playlist has ended, it will start playing at the beginning of the playlist again
  • disablekb=1 – Disables the keyboard controls
  • cc_load_policy=1 – Automatically turns on captions
  • modestbranding=1 – Removes the YouTube logo from the control bar
  • Privacy-enhanced mode – This is done by checking the “Enable privacy-enhanced mode” checkbox. The URL changes from www.youtube.com to www.youtube-nocookie.com.

View a full list of parameters & explanations »

Examples

Disable fullscreen mode (note “allowfullscreen” has been removed):

<iframe src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G" width="640" height="360" frameborder="0"></iframe>

Hide player controls controls=0:

<iframe src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&controls=0" width="640" height="360" frameborder="0" allowfullscreen></iframe>

Hide playlist title & sharing options showinfo=0:

<iframe src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&showinfo=0" width="640" height="360" frameborder="0" allowfullscreen></iframe>

Autoplay the 1st video in the playlist on page load autoplay=1:

<iframe src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&autoplay=1" width="640" height="360" frameborder="0" allowfullscreen></iframe>

Automatically loop the playlist loop=1:

<iframe src="https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&loop=1" width="640" height="360" frameborder="0" allowfullscreen></iframe>

You can combine as many of these options as you’d like, just adding an & between each one. Your src attribute would look something like this:

https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smtK4DDW6qTeoAoaBpr3vY0G&controls=0&showinfo=0&autoplay=1&loop=1

04 How to Embed a YouTube Playlist in your WordPress Sidebar

A new video widget was introduced in WordPress 4.8, and as of version 4.9, it now supports embedding YouTube playlists.

Embed YouTube playlist into WordPress sidebar

  1. Navigate to Appearance > Customize
  2. Click on Widgets
  3. Then find the sidebar area that you want to add the video to (you might have multiple sidebar areas listed)
  4. Click Add Widget
  5. Search for the Video widget, and click on it
  6. Click the Add Video button
  7. Click Insert from URL
  8. Paste the playlist URL into the box
  9. Click Add to Widget
  10. At the top of the Customizer, click Publish

Alternatively, you could use the <iframe> method described above, and insert the <iframe> code into a Text Widget. Here’s a quick animation:

Animation of embedding YouTube playlist in WordPress sidebar

  1. Navigate to Appearance > Customize (you could also go to Widgets, but Customize shows you a real-time preview)
  2. Click on Widgets
  3. Then find the sidebar area that you want to add the video to (you might have multiple sidebar areas listed)
  4. Click Add Widget
  5. Search for the Text widget, and click on it
  6. Switch from Visual to Text mode
  7. Paste your <iframe> embed code
  8. At the top of the Customizer, click Save & Publish

Gimme a shout in the comments if you have any trouble embedding a YouTube playlist on your WordPress site.

Dave Warfel

LinkedIn  •  X (Twitter)
Dave has been working with WordPress since 2011. He's built 100s of client sites and almost a dozen of his own. He's tested almost every plugin you can think of, hosted with at least 10 different companies, and gone down every SEO rabbit hole you can imagine. When's he's not tinkering with new software, you'll find him in the mountains of Colorado, trail running, summiting peaks, and rippin' downhills on his mountain bike. 🏔️🏃🚴🤸

23 responses to “How to Embed a YouTube Playlist in WordPress”

  1. Diana Avatar
    Diana

    This was really helpful. Thank you!

    1. Dave Warfel Avatar

      You’re welcome, Diana. Glad you found it useful :-)

  2. Sandy Avatar
    Sandy

    do you know if there is an issue with the oembed in the DIvi theme? it is not working like shown in Divi or Extra theme. Appreciate your help.

    1. Dave Warfel Avatar

      Hi Sandy — I’m not aware of how Divi processes oEmbeds. But because Divi has its own video module, which does have support for YouTube & Vimeo, it’s possible that it doesn’t support oEmbeds like most WordPress themes.

      Did you try using the Divi video module?

      If not, I would recommend you try using a Divi Text module, and pasting in the <iframe> embed code (as in option #3 above). Give that a go and report back.

  3. Tommy Avatar
    Tommy

    Hello, do you know if you can insert a caption under a youtube playlist that is synchronized with the videos?
    I try to explain better, every day I post a new video in the playlist and this appears on the site, when it appears, I would like to write a caption that describes the reason for the video and the two things should work in unison.

    1. Dave Warfel Avatar

      Hi Tommy — Unfortunately, I don’t believe there is any way to do that. YouTube does not provide that option. Sorry.

    2. Tommy Avatar
      Tommy

      Thanks anyway Dave, very kindly.

  4. Spenelo Avatar
    Spenelo

    Haha, almost felt embarrassed by how easy it is.

    Thanks for your tut!

    Regards

    1. Dave Warfel Avatar

      Haha. It’s always a nice surprise when it’s easier than we think :-)

      Thanks for taking the time to write in.

  5. Custom Avatar
    Custom

    its not working in elementor.

    1. Dave Warfel Avatar

      Elementor does not appear to support YouTube playlists with their Video widget. However, you can use the Text Editor widget.

      Using the Text Editor, if you’re in “Visual” mode, you can simply paste the playlist URL on it’s own line. It might not appear right away, but if you preview or publish the page, you’ll see the embedded playlist.

      Alternatively, also using the Text Editor widget, you can go into “Text” mode and use the <iframe> method. That should work as well.

  6. Debasish Mondal Avatar
    Debasish Mondal

    I want to show the playlist like https://abpananda.abplive.in/video/fatafat-515992 , where the playlist videos thumbnail and others visible.

    How can I do that?

    1. Dave Warfel Avatar

      Hi Debasish — You’ll need a plugin to display YouTube playlists like that. I recommend checking out YouTube Embed Plus. Start with the free version, but if you need more features & control, check out their pro version.

    2. Debasish Mondal Avatar
      Debasish Mondal

      Hi Dave,
      Thank you very much for your suggestion and we checked the plugin too. But it will not serve as per our needs. We want to show a playlist/channel videos like attached image. Image

    3. Dave Warfel Avatar

      If that won’t work, the best I can do is send you to the YouTube API page. You might need to get a developer to code something specific for you.

  7. Bruno Avatar
    Bruno

    Hi, thanks for this post :)
    Is it possible to choose which video of a playlist will start playing, if yes with oembed ?

    Thanks

    1. Dave Warfel Avatar

      Hi Bruno — I just tried it with the oembed method and it didn’t work. It always started with the first video in the playlist. So I don’t think it’s possible.

    2. Bruno Avatar
      Bruno

      Thanks for trying, bye :)

  8. Nora Avatar
    Nora

    Hi, Thanks for the resume.
    I have used the wordpress widget and it only plays the first song of the playlist and the rest of the songs doesn’t appear on the video. When the first song is played it doesn’t start playing the next song.

    Have anyone else had this issue? Any recomendations?
    Thanks

    1. Dave Warfel Avatar

      Nora — Do you have a link to the page where your playlist is embedded? That might help us understand a little better exactly what’s going on.

  9. Spooky Boo Avatar
    Spooky Boo

    I’m also trying to use the playlist link and it only links to the first video. It does not continue to the next video in the playlist.

    The sample is at https://www.scarystorytime.com

    1. Dave Warfel Avatar

      If you’re referring to the video in the left sidebar, the code you’re using is for a single video, not a playlist. The playlist embed code should have something similar to this in the src value:

      https://www.youtube.com/embed/videoseries?list=PLJ62e5IH_smvpCFlOd5tRWPXyESho0SfA
  10. J Avatar
    J

    Hi I realise that we can’t display the videos below in gallery layout without a plugin, but there must a parameter to load the playlist with the playlist open? (The dark box at the side showing the videos in the playlist which comes up when you click the playlist icon at the top)

    Most people dont realise it is a playlist unless this is open…
    Poor design from YouTube.

Leave a Comment