WordPress plugins, tips and tricks

YouTube Channel

YouTube Channel

YouTube Channel addon for WordPress allows you to display widget with latest or random video from YouTube channel, playlist or favorite. After installation simply add widget to sidebar, enter name of channel or playlist ID, and the latest video from selected resource will be shown on your site.

Jump to: Features | Download | Installation | FAQYouTube Data API Key | Usage | Shortcode | Customize | Credits | Your Support


In addition to show the latest videos, YouTube Channel allow user to:

  • show video as HTML5 (iframe), Asynchronous HTML5 (iframe2), or thumbnail (default)
  • show one or more videos
  • show videos in regular or random order
  • show videos from channel, favorited videos, liked videos or playlist
  • show individual videos or embed playable seek YouTube playlist block (with all videos from channel, favourited videos, liked videos or playlist)
  • set aspect ratio of displayed videos/thumbnail (16:9 or 4:3)
  • set custom basic video width (default 306 px)
  • enable video autoplay (not on mobile devices)
  • mute video on autoplay
  • caching youtube feeds
  • insert YTC to content with shortcode (VisualComposer ready)
  • NEW! Works with YouTube Data API v3

And that is not all! You can also:

  • for thumbnail mode open video in lightbox (Magnific Popup)
  • set custom widget title
  • toggle name of video above embed and/or description below embed
  • move video title below embed
  • toggle video info
  • toggle visibility and set custom text for link to channel/vanity/legacy username page
  • enable opening link to channel in new tab/window (by javascript for valid XHTML or with target=”_blank”)


ChangeLog you can find here. For download visit official WordPress.org page here http://wordpress.org/plugins/youtube-channel/ or get package below (latest or some of older versions if you like):


YouTube Channel is easy to install, same as any other extension. You can do it manually or automatic.

  1. For manual installation: download, unpack archive and upload directory youtube-channel to wp-content/plugins/ directory on your hosting server with some FTP client (I recommend free and safe FileZilla).
  2. For automatic installation: go to PluginsAdd New, enter keyword youtube channel, click Search button, then click link Install Now.

YouTube Data API Key

Version 3.0.0 brings support for YouTube Data API v3. So, to make plugin work, you must generate your own YouTube Data API Key and insert it on GLobal plugin settings page

Learn more about Obtaining authorization credentials and watch explanation video below.

While you follow video tutorial above, you are free to create Server Key and add IP of your server to allowed servers. If you don’t care, you can leave key unprotected and allowed for all IP’s, but I don’t recommend that – always work out and protect your API Key, and NEWER SHARE IT WITH OTHERS!

Next, when you create your own API Key, simply from your Dashboard visit Settings → YouTube ChannelGeneral and insert your key to field YouTube Data API Key (you’ll see dots instead real characters).

YouTube Channel 3: Add Data API Key
YouTube Channel 3: Add Data API Key


After activation on Plugins page, update global plugin settings, then add widget to sidebar on Appearance Widgets, and proceed with widget configuration.

Please note, only Channel ID is required, or on your site will be displayed video from my channel. All other options are optional.


You can also insert YTC block with shortcode [youtube_channel]. All options for shortcode are taken from global settings page, but you can override them by setting individual option to shortcode.

General Settings

  • class (string) custom class for YTC block to target special stylig
  • channel (string) ID of preferred (your) YouTube channel, and you can get it from https://www.youtube.com/account_advanced
  • vanity (string) custom vanity name
  • username (string) legacy YouTube username
  • playlist (string) ID of preferred YouTube playlist.
  • resource (int) Resource to use for feed:
    • 0 Channel
    • 1 Favorited videos (for defined channel)
    • 2 Playlist
    • 3 Liked videos (for defined channel)
  • only_pl (bool) If you wish to embed seek playlist for any resource (playlist, channel, liked of favourited videos), simply set this option to true (1 or true). This option will override “random” and “num” parameters.
  • cache (int) Period in seconds for caching feed. You can disable caching by setting this option to 0, but if you have a lot of visits, consider at least short caching (couple minutes).
  • fetch (int) Number of videos that will be used as stack for random pick (min 2, max 50)
  • num (int) Number of videos to display per YTC block.
  • random (bool) Option to randomize videos on every page load.

Video Settings

  • ratio (int) Set preferred aspect ratio for thumbnail and video. You can use:
    • 3 16:9 (widescreen)
    • 1 4:3
  • responsive (bool) To enable responsive thumbnail or embedded video player.
  • width (int) Width of thumbnail and video in pixels.
  • display (string) Object that will be used to represent video. We have couple predefined options:
    • thumbnail Thumbnail will be used and video will be loaded in lightbox.
    • iframe HTML5 (iframe)
    • iframe2 HTML5 (iframe) with asynchronous loading – recommended
  • themelight (bool) By default YouTube have dark play controls theme. By setting this option to 1 or true you can get light theme in player (HTML5 and Flash)
  • controls (bool) Set this option to 1 or true to hide playback controls.
  • autoplay (bool) Enable autoplay of first video in YTC video stack by setting this option to 1 or true
  • mute (bool) Set this option to 1 or true to mute videos set to autoplay on load

Content Layout

  • showtitle (bool) Set to 1 or true to show video title. Disabled by default.
  • titlebelow (bool) Set to 1 or true to move video title below video. Disabled by default.
  • showdesc (bool) Set to 1 or true to show video description. Disabled by default.
  • desclen (int) Set number of characters to cut down length of video description. Set to 0 (zero) to use full length description.
  • noinfo (bool) Set to 1 or true to hide overlay video infos (from embedded player)
  • noanno (bool) Set to 1 or true to hide overlay video annotations (from embedded player)

Link to Channel

  • goto (bool) Set to 1 or true to display link to channel at the bottom of YTC block.
  • goto_txt (string)
  • popup (int) Control where link to channel will be opened:
    • 0 (int) Open link in same window
    • 1 (int) Open link in new window with JavaScript
    • 2 (int) Open link in new window with target=”_blank” anchor attribute
  • link_to (int) URL where link will lead:
    • 2 (int) Vanity custom URL (default)
    • 1 (int) Channel page
    • 0 (int) Legacy username page

Shortcode Example

Shortcode Explained

  • Get one (num=1) random (random=1) video from YouTube channel (resource=0) UCRPqmcpGcJ_gFtTmN_a4aVA (channel=UCRPqmcpGcJ_gFtTmN_a4aVA)
  • Cache feed for one hour (cache=3600)
  • Automatically start video playback (autoplay=1) in responsive HTML5 player with asynchronous load (show=iframe2)
  • And hide show link to channel below YTC block (goto=0)

Customize look and feel

We implemented classes for all YouTube Channel objects, so we can easy style presence of YTC by personal preferences. Simply add to style.css for your theme styling for classes:

  • .widget_youtube-channel – class of whole widget (parent for widget title and YTC block)
  • .youtube_channel – YTC block wrapper class. Additional classes are available:
    • .default – for non-responsive block
    • .responsive – when you have enabled responsive option
  • .ytc_title – class of H3 tag for video title above thumbnail/video object
  • .ytc_video_container – class of container for single item, plus:
    • .ytc_video_1, .ytc_video_2, … – class of container for single item with ordering number of item in widget
    • .ytc_video_first – class of first container for single item
    • .ytc_video_mid – class of all other containers for single item
    • .ytc_video_last – class of last container for single item
    • .ar16_9 – class for Aspect Ratio 16:9
    • .ar4_3 – class for Aspect Ration 4:3
  • .ytc_thumb – class of anchor for Thumbnail mode
  • .fluid-width-video-wrapper – class for parent element of IFRAME for enabled responsive
  • .ytc_description – class for video description text below thumbnail/video object
  • .ytc_link – class of container for link to channel


Localisation enabled in version 0.1.3 thanks to Milan Dinić.

And we appreciate your support

Spread voice about YouTube Channel on social networks, rate and review on WordPress.org, feedback in comments below or

79 Responses to YouTube Channel

  1. Hi, I cant get the pluggin to work. Here is the debug code i am getting.

    server: Apache/2.2.25 (Unix) mod_hive/3.6 mod_ssl/2.2.25 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_qos/10.10 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ mod_jk/1.2.37

  2. I installed your youtube channel plugin, but have a problem. I have set it up, but from the site I click on visit youtube channel (TradingOptions4Income) it takes me to youtube and youtube says channel doesn’t exist. But it does exist, I can go to it with no problem. I have checked the typing in the link and its correct. Can you offer any suggestions?


  3. Since the update this us the error we are getting. Any suggestions. Thank you.

    Warning: base64_decode() expects parameter 1 to be string, object given in /home/robco/public_html/hoodlumfightgearnews/blog/wp-content/plugins/youtube-channel/youtube-channel.php on line 574

    • Yes, sorry for troubles.
      Because we changed caching method, from Help tab on plugin Settings page do ReCache (read help page).
      That issue will be self-solved when previous cache expire.

  4. Hi, I cant get the pluggin to work. Here is the debug code i am getting.

    server: Apache/2.2.29 (Unix)
    php: 5.3.29
    wp: 4.0
    url: http://www.pixelbirnen.de
    title: null
    class: null
    channel: Pixelbirnen TV
    vidqty: 1
    playlist: null
    use_res: null
    cache_time: null
    only_pl: null
    getrnd: null
    maxrnd: 25
    goto_txt: null
    showgoto: null
    popup_goto: null
    showtitle: null
    showvidesc: null
    descappend: …
    videsclen: null
    width: 306
    to_show: thumbnail
    autoplay: null
    autoplay_mute: null
    norel: null
    controls: null
    fixnoitem: null
    ratio: 3
    fixyt: null
    hideinfo: null
    hideanno: null
    themelight: null
    debugon: on
    userchan: null
    enhprivacy: null

    Thanks For Help!!

    • If you click “Check here why” link, you’ll get message from Youtube

      Invalid value for parameter: username

      So, Pixelbirnen TV is wrong YouTube username. Please provide URL to your YouTube channel page.

  5. thank you ,
    now it works.
    But there is a new error .
    The plugin is now running sometimes yes sometimes no.

    server: Apache/2.2.29 (Unix)
    php: 5.3.29
    wp: 4.0
    url: http://www.pixelbirnen.de
    title: Pixelbirnen TV @ Youtube
    class: null
    channel: UCS2o749CY-VNJDyKIxYFsLw
    vidqty: 2
    playlist: null
    use_res: null
    cache_time: null
    only_pl: null
    getrnd: null
    maxrnd: 25
    goto_txt: null
    showgoto: null
    popup_goto: null
    showtitle: on
    showvidesc: null
    descappend: …
    videsclen: null
    width: 280
    to_show: thumbnail
    autoplay: null
    autoplay_mute: null
    norel: null
    controls: null
    fixnoitem: null
    ratio: 3
    fixyt: null
    hideinfo: null
    hideanno: null
    themelight: null
    debugon: on
    userchan: null
    enhprivacy: null

    • I refreshed your homepage and Gewinnspiele page 10+ times, and every time YouTube Channel displayed two video thumbnails.

      Please explain “running sometimes yes sometimes no” (some error, screenshot, something that I can understand better) :)

  6. TREMENDOUS!!! Thank you man! If there is somewhere I can give you a “high five” with a great review then please let me know. Not only is this an excellent plugin that is easy to use, but also they have excellent technical support to help get it perfectly right or be open to suggestions for future updates. It works PERFECTLY! Thank you!

  7. Could you give us an example of the shortcode with revisions in action please so we can see the correct syntax to use?

    Is it possible through using the shortcode overrides for ‘channel’ to display different channels on different pages using this plugin?

      • Thank you SO much! That small little piece of sample code gave me the answer I needed so now i can add a mix of channels on my niche sites.

        Thanks again!

  8. hello,

    i just got a ” Ups, something went wrong. ”
    and i don’t know why D:

    here’s the JSON log:

    date:Mon, 11 May 2015 04:26:56 +0000
    goto_txt:Visite o Caipira Valley no Youtube!

    And, which file should i edit if i want to change the ‘go to text’ to a ‘go to image’?

    Best regards,

  9. sorry for not had read that before, and thank you for the fast support!
    here we go with the questions of the topic:

    1 – http://caipiravalley.com.br/
    2 – WP 2.2.2
    3 – YTC 3.0.3
    4 – No caching plugin
    5 – I made a browser API key and just set the URL of my website
    6 – I was using the plugin by widget in my blog rigth sidebar
    7 – I just installed it and when i refreshed my website it didn’t work
    8 – I was just expecting it to show the video thumb(i don’t think this question apply for me haha)

    that’s it, thank you for the awesome plugin.


  10. Except you use WP 4.2.2 instead 2.2.2 😉 all other looks OK.

    Remove URL of website from API Key on Google, that should resolve issue. I had no success to make that restriction to work.

    • Hi Carolyn,

      Message “Coming soon…” is printed when there is no YOUTUBE_DATA_API_KEY in wp-config.php. So please, check did you uploaded wp-config.php back to server after you added API Key per instructions?

  11. I generated the code, but now I cannot find wp-config.php. I have looked all through the edit settings for this youtube channel widget, still yet I cannot find where to insert the YOUTUBE_DATA_API_KEY.

  12. I have enter code into wp-config.php , “define(‘YOUTUBE_DATA_API_KEY’, ‘AIzaSyBZHB7qZBSeA53CBQwoWijYMRC2aXRfnZU’);” , but the problem still remain >> YouTube Channel version 3+ requires YouTube DATA API Key to work . My data API key should can be work as i have follow the steps above

    • Please check did you uploaded file to server. If it remain on your computer, then wp-config.php is unmodified on server. And I don’t kidding, already had users with exactly that problem – file modified in localhost but not uploaded to server.

  13. I currently open my wordpress in localhost, , its still cannot address the problems as all steps i have try.

  14. Having to uninstall plugin for now; having to touch wp-config.php manually negates the ease of using plugins. This should be something we can add into the plugins settings within the dashboard, never manually editing php.

  15. Then enable debugging in WordPress and tell me is there something mentioned regarding YouTube Channel plugin?

    Or, add to active theme functions.php following code:

    and tell me did you got your Data API key or word “FAIL” when you load website on localhost (at the beginning of BODY)?

  16. Thanks for getting back to me. Now that I have done as you said, the widget says, “Ups, something went wrong.”

  17. Isn’t there a way to install the api key without digging into the code? I tried it – I am not a programmer and it didn’t work. I loved your ap until you did this…so not it is down and off my site. Will you be integrating it at any time?

  18. I just updated the plugin today, 5/14/2015, and the dashboard doesn’t look like the one above where I can plug in the API key. In fact, nothing changed when I updated the plugin. Any suggestions?

  19. Thanks! Ok, it’s all done but it still says “Oops, something went wrong” where the player is supposed to be on my home page. I’m not sure what legacy YT name is but I’m not quite sure that that is the problem.

  20. I have a question. Before the api changes. i was using a channel that i favorite the most.I’m having a hard time getting to work.Is the api changes work only for the author of the channel and not others?

  21. The plugin stopped working. I added the new api key and updated everything, but I’m hetting an “Oops something went wrong.” for the homepage widget. Any thoughts?

  22. The plugin stopped working. I added the new api key and updated everything, but I’m hetting an “Oops something went wrong.” for the homepage widget. Any thoughts?

    Nevermind it’s working now. Had to remove the server ip address.

  23. sorry for the late reply.I got it working removing the server ip address in the api..

  24. After update I am getting: YTC ERROR: You have set to display videos from Channel (User uploads) [resource list ID: UU7EnSWFvi1ZDBnfy-fpGasQ], but there have no public videos in that resouce.

    Can you help me?

  25. Hi Aleksandar,

    Is there any way to enable the auto play function of a video when a user hovers with his mouse over that video?


    • Hi Josh,

      No, there is no such option in plugin because that has not good solution globally, and not mobile friendly.
      But, you can use JavaScript to do that on your own website if you wish.


    • Hi Hans,

      Well, exclude iframe with class .mfp-iframe from this rule in your style.css file (line 476):

      iframe[src*="youtube.com"], iframe[src*="youtu.be"] {
      width: 425px !important;
      height: 265px !important;

      With that important rule you killed responsiveness.

  26. This code in css is used to display the normal embeds right in blogpostings. So it cannot be changed. Or do you see another solution? For example what about the dynamic wall? Do you have some code for that somewhere?

    • Fire your developer (just kidding :) ) and replace old CSS rule with this:

      iframe[src*="youtube.com"]:not(.mfp-iframe), iframe[src*="youtu.be"]:not(.mfp-iframe) {
      width: 425px !important;
      height: 265px !important;

      Regarding Dynamic Wall from 3.0.8alpha3 version (actually, gallery mode will be implemented probably to v3.1 because require more testing), when you select gallery for “What to show”, everything should work out-of-the-box. Have you played with it?

  27. Thx. Will give him this suggestion (of the code 😉 )
    I did not play with it. Is it possible to have playlists as gallery? I thought I saw that it is just the channel.

  28. Hey,

    here is Promptly from the german ARK Forum. We are using WBB4.
    Is there a version for WBB, which we can use in our ARK: Survival Evolved Community?

  29. Did the suggested changes and got my api. Now works fine and have three channels on the site I do for a local charity for free.

    However, if I try and insert the ip in the api credentials the plugiin stops working even though I’m sure the ip address is correct as I get it from the hosting control panel.

    If I delete the ip restriction everything works fine. Not a problem on a small low volume site but wondering why it does this.

    • Hi Colin,

      Somehow Google detect wrong IP of host. Sometime it works, but in most cases does not work.
      Btw, even on high traffic websites with enabled YTC feed cache for at least 5 minutes, YouTube Data API quota will have low usage rate because API is queued only once per 5 minute for individual feed.

      That is why I focused to fetch feeds through PHP than through JavaScript (browser key), as with PHP we can cache feed to WP database.


  30. Nice plugin, got it to work.

    What shortcode(s) would I use to create 12 thumbnails, that are responsive and will open as a single video in a light box?

    Beer coming your way 😉

    • Try with:
      [youtube_channel num=12 responsive=1 display=thumbnail]

      Also, in general settins set channel or playlist ID and select resource which you wish to use. Or set them directly in shortcode.

      I’m happy to receive at least one more cold beer 😉

  31. Nope. tried the [youtube_channel num=12 responsive=1 display=thumbnail]

    Under general settings: Resource to use – playlist, fetch 12 show 12.
    Under Video: What to show “Embedded Playlist.


  32. Actually I just found what I want, with your “YouTube Channel 3 – Display: Gallery (default)”. Just signed up to beta test this.

    When do you think it may be ready for full release?

    BTW Thanks for all your help!

  33. Hello Sir/Madam, I can’t find the solution from (YTC ERROR: There are no HTTP transports available which can complete the requested request.)and I can’t not click on (Video , Content, Link to channel,tools,…but it auto click on general )please help me now.

  34. Your plugin never works throwing error about API key, but the SAME API works with another plugin.
    Any ideas?
    I’d like to test yours since the other plugin always shows a giant video before the channel thumbnails, and I only want the thumbs.


Leave a reply