How to autoplay a youtube video

  • I am trying to autoplay a Youtube video on my website. However it doesn’t seem to start. Is there anyone who can help me with the code? Or does a free wordpress account disable autoplay? This is the code I used:

    Thanks in advance!

    The blog I need help with is: (visible only to logged in users)

  • Hi @carsare90.

    As your site is set to private I couldn’t access. However, I think I can help you anyway. Are you trying to embed a Youtube video in a post or page? If this is the case, you should get the embed code of the targeted youtube video, through the following steps:

    1. Go to the youtube video page.
    2. Click the “Share” button below the video.
    3. Click on the embed tab and copy the code. (it might be something like this: <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/yYQ7fCaRqh8″ frameborder=”0″ allowfullscreen></iframe>
    4. Past the code on your post/page editor, using the HTML tab.
    5. add the following data to the end of the src link “?autoplay=1”.

    The result is something like this: <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/yYQ7fCaRqh8?autoplay=1″ frameborder=”0″ allowfullscreen></iframe>

    If you prefer to watch a video to get the instructions you can check this one: https://www.youtube.com/watch?v=yYQ7fCaRqh8

  • The only youtube Video Customization Options here at wordpress.COM are found in this support doc at https://en.support.wordpress.com/videos/youtube/#video-customization-options

  • Hey, @caesare90. I realized that you will only be able to set up autoplay through the way I informed you if you have a Business Plan subscription. A code such as “iframe” is not allowed on the Premium Plan and below for security reasons. You can find more information regarding codes here: https://en.support.wordpress.com/code/

    If you need more information about Business Plan or anything else, feel free to ask.

  • Thank you for the quick replies. I am indeed currently still on the free plan and looking to upgrade later. Meaning the autoplay feature is simply blocked for me at the moment. I’m still hesitating about which plan is ideal for me. Most of the plug-ins seem ideal but it’s meant for a non-commercial website.

  • Hi! No, you don’t need a business plan subscription to do this.
    Go to your blog, and add /wp-admin/ to it, for example:
    http://mysite.wordpress.com/wp-admin/

    Then go to your post (or make a new one), and add the code that guicmazeredo described. It worked for me!

  • Hi @fjrdstrm.

    Are you sure the iframe code worked on your free site? I’ve tried on mine and I had no success. Then I tried on my Business Plan site and it worked. Trying to understand the difference I’ve found the following information regarding codes on WordPress.com:

    If you are familiar with HTML, you’ll notice that codes such as embed, frame, iframe, form, input, object, textarea and others are missing from the above list. Those codes are not allowed on the Premium Plan and below for security reasons.

    @caesare90 the plan that better suits you depends on what your needs are. Feel free to tell me what’s your goals with your site and the main features you plan to have and I can maybe indicate you the best choice.

  • Hi, it works on my Personal plan.
    Apparently, within /wp-admin/, YouTube-links or embed codes don’t get automatically converted to WordPress code.

    If I paste the same iframe in WordPress.com, the iframe gets disabled.
    If I do it in /wp-admin/, it doesn’t.

    (Now I hope this doesn’t get changed. It’s just a YouTube video — Unless they add an autoplay feature within WordPress.com)

  • You got it @fjrdstrm! I’ve pasted the iframe code the /wp-admin/ in my free site and it worked.

    @caesare90, just to emphasize so you don’t get lost after a lot of tries, follow the steps I gave you in my first reply through your WP Admin dashboard. You can get to this dashboard by adding /wp-admin to the end of your site’s URL, in this case: https://valarenglish.wordpress.com/wp-admin

    I guess now you will be able to make it work. :-)

  • It seems like I should have just kept quiet…
    They “fixed” it now. My videos don’t autoplay anymore with /wp-admin/.

  • Thanks for the help guys. @guicmazeredo the website will be for students of English as a second language. So educational purposes. I’ll stay satisfied with just having to press play haha.

  • Glad to help, @caesare90.

    Hope your students can learn a lot!

    Best wishes!

  • The topic ‘How to autoplay a youtube video’ is closed to new replies.