[closed] default embedded youtube video size (12 posts)

  1. stefanocps
    Posted 1 year ago #

    is there a way to change the default size of the embedded youtube video?or better still, to have them responsive?
    i have googled but haven't found a proper solution..some don't work, some work half, other are not easy to understand

  2. J M
    Posted 1 year ago #

    Try this Shortcode: [embed width="123" height="456"]YOUTUBE URL[/embed]. See more info: Embeds

  3. stefanocps
    Posted 1 year ago #

    i know that, but i was looking for something that make it by default
    that is also becuase i want to be applied to sites where i already have lots of videos..don't want to change all the posts!

  4. stefanocps
    Posted 1 year ago #

    anyway that code don't work

  5. J M
    Posted 1 year ago #

    Try using this filter:

    add_filter( 'embed_defaults', 'change_embed_size' );
    function change_embed_size() {
        // Adjust values
        return array('width' => 100, 'height' => 100);

    Change the dimensions to suit you, and add to functions.php

  6. stefanocps
    Posted 1 year ago #

    this code also don't seems to work. it is one of those i have found through Google with no success

  7. stefanocps
    Posted 1 year ago #

    any other solution to this issue?
    i have tested that code on different themes
    i would be happy to have it work in twentyeleven
    but it does not

  8. stefanocps
    Posted 1 year ago #

    i don't understand if this is solvable or not in wordpress
    i have tried to open all php of a theme and i could not find the original setting for the video embed size
    shoud it be somewhere or not?

  9. davidbfox
    Posted 1 year ago #

    Found this fix that worked for me: http://stackoverflow.com/a/20007094

  10. dmitriyk
    Posted 11 months ago #

    I had this issue 5 mins ago.

    Solution is:

    • Use youtube's Share->Embed
    • Create <div style="width: 800px; height: 600px"> (or any size that your youtube video is) around the <iframe>
    • Reply in this thread if it helped you. Or you talking about something else.
  11. razor1231
    Posted 10 months ago #

    I have a similar issue :(

    My youtube videos embedded in my domain http://www.bestkitchenfaucetshub.com/ are not showing the right size.It shows always a small size.THe above solution didn't worked for me.

    any good suggestions are appreciated!!

  12. Andrew
    Nuh uh moderator
    Posted 10 months ago #

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.