How to Embed video in widget

Community Forums Forums General Discussion How to Embed video in widget

This topic is: not resolved

This topic contains 8 replies, has 5 voices, and was last updated by  Summer 2 years ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #54011


    Hi guys,

    I have tried to embed video in the widget area but, it is not showing.

    I have activated jetpack and I placed this code into the footer : [youtube=]

    but the video did not show up in the widget whereas it showed in the post and page of the site.

    Could somebody help me with the specific code to embed video in the widget area?


    • This topic was modified 2 years, 1 month ago by  Gordy.
    • This topic was modified 2 years, 1 month ago by  Gordy.


    The shortcodes don’t seem to work in Text Widgets so you need to place the regular embed code from Youtube.



    Yes, the embed code is the easiest way.

    Or add support for shortcodes in widgets to your child themes functions.php file:

    add_filter(‘widget_text’, ‘do_shortcode’);



    I don’t understand what you meant by “the regular embed code”

    I copied the url of the youtube video below as the video was playing into the text widget of my site, but it showed same raw code on my site.

    The code is :

    Please what else do I need to add to the code that I copied when the video was playing on youtube to the text widget on my site, to get the video displayed?



    Using only the URL of the video only works in posts and pages (and comments if you make an adjustment).

    If you want to place a video in a text widget, your easiest way is to click on the “Share” button for the video, select “Embed” option, and paste that code in the widget. It’ll look something like this:

    <iframe width="420" height="315" src="//[video code here]" frameborder="0" allowfullscreen></iframe>

    Not sure when they started excluding the “http:” from their URLs, but they’re YouTube, so they can do almost whatever they want.



    Hi Summer,

    Thank you so much. I never thought about that.

    But, is there a way to stop related video from showing up using the example you gave?



    You can see a list of options here:

    but the ones I use most are showinfo=0 (showing video title/info) and rel=0 (showing related videos after)

    For your video, the code would look like this:

    <iframe width="420" height="315" src="//" frameborder="0" allowfullscreen></iframe>

    or this:

    <iframe width="420" height="315" src="//" frameborder="0" allowfullscreen></iframe>

    You can also adjust the video dimensions when choosing the embed code, to one of YouTube’s defaults, or a custom size to fit your sidebar.



    Hi, can you please give the coding for a self-hosted video clip? I have my clip hosted on my commercial ISP, and the file is correctly uploaded here:

    [video src="" /]

    What I want to do is embed it in a Text widget in a primary sidebar in a smaller size. I’ve downloaded a lot of plug-ins, but none seem to do it. I would like to have the screen image, media controls, and the ability to click on something to make it expand in size … if that is possible.

    thanks, jim



    Which plugins have you tried? I’d guess that if you used one that had shortcodes, and added Brad’s code above for adding shortcode functionality to widget areas, that should do the trick.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.