Blog: Web Design
Smartphone with YouTube app open

How To Make A YouTube Video Embed Autoplay On Page Load

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown Design & SEO.

Recently, I had to look up how to make YouTube videos autoplay — I thought this might be beneficial to other people. There’s also other parameters you can add to embed codes to control the user experience if you want to experiment on your own.

A regular YouTube embed code looks something like this:


<iframe width="560" height="315" src="//www.youtube.com/embed/CcgvVt3QJUI" frameborder="0" allowfullscreen></iframe>

What we need to do is add a question mark to the end of that, to allow for parameters (options), and then we add the option to make the video autoplay.

You’ll need to add ?rel=0&autoplay=1 to the end of the embed URL. The rel is to control whether related videos play at the end or not. 0 indicates no, 1 indicates yes. The autoplay parameter controls whether the video autoplays in the same fashion — 0 for no, 1 for yes.

The finished embed code should look like the following:

<iframe width="560" height="315" src="//www.youtube.com/embed/CcgvVt3QJUI?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>

You can find the entire list of YouTube embed parameters on the Google Developers site. There is also a video below explaining how to change the embed code to make your videos autoplay once the page loads.

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown Design & SEO.

4 comments on “How To Make A YouTube Video Embed Autoplay On Page Load

  1. Hi Georgia:

    This is something you would have to talk to your school’s IT department about. This may be difficult to accomplish, as there are several workarounds published online for the express purpose of getting around a YouTube block on school WiFi or computers.

Join the Conversation

Your email address will be kept private. Required fields marked *.