How To Easily Embed A YouTube Video In Your Website

YouTube is one of the most popular video platforms on the web with over a billion views every day. But, you will also find YouTube videos on many other websites, using the embed feature. And, if you are looking to embed a YouTube video in your site, then there are a number of parameters that allow you to embed the video the way you choose. The parameters allow you to autoplay, show/hide controls, disable full screen, and so on.

Get the embed code from YouTube

  1. Browse to the YouTube video that you want to embed or share.
  2. Click the Share button below the video. A popup will open with share options and the share link shown
  3. Click on the embed button to get the HTML code to embed a Youtube Video as shown in the image below. Copy the video embed code.
embedlink only

The Embed Parameters

There are many YouTube parameters that you can use, offering a user control over many aspects of a video. Some of the more popular ones are:

  • autoplay
    • autoplay=0 (default); YouTube embed Autoplay is disabled
    • autoplay=1; autoplay enabled, the video starts to play automatically on page load
  • controls
    • controls=0 ; player controls not displayed
    • controls=1 (default); player controls displayed
  • fs
    • fs=0 ; full screen button disabled
    • fs=1 (default) ; full screen button enabled
  • rel
    • This particular parameter has undergone a change effective Sept 25th, 2018. In the past, you could use this parameter to disable the display of suggested or related videos at the end of a video. From Sept 25th, you will not be able to disable suggested or related videos, since it is considered an intrinsic part of the YouTube platform. Please note, the parameter is still valid and you can use it to set the suggested or related videos to show only videos from the same channel.
    • rel=1 (default); shows suggested or related videos from all YouTube channels
    • rel=0; suggested or related videos from the same channel
  • Enhanced Privacy Mode
    • Enhanced privacy mode allows you to embed a youtube video without using cookies to track user behavior. Any recommended videos will be purely based on the context of the current video playing.
    • To use this feature, replace ” https://www.youtube.com” with “https://www.youtube-nocookie.com” in the embed code.
  • Set Start and End Time of an Embedded YouTube Video

An Example

You can see an embedded video from YouTube below, using the above parameters. The YouTube video is set to play with autoplay OFF, controls OFF, full-screen mode disabled, and enhanced privacy mode switched on. The code to embed a Youtube Video looks like this, with the parameters highlighted:

embed a youtube video
YouTube Embed Code with Parameters Highlighted

If you using a platform like WordPress or similar for your website, then it is quite likely that you probably have a YouTube Block in the platform’s frontend editor, that provides the HTML wrapper to insert the YouTube Video into your website. In this case, you won’t need full HTML code to embed the video. You will need the Youtube Video URL with the Video ID appended at the end, which looks like this:

“https://www.youtube.com/embed/MqNd1xD46VY”

The video ID is the alphanumeric text MqNd1xD46VY. The video ID is the unique identifier for a YouTube Video.

You can enter the URL as shown above along with the required parameters appended at the end as explained above. For example:

To embed a YouTube video in your website with Auto play on, use the following URL:

“https://www.youtube.com/embed/MqNd1xD46VY?autoplay=1”

To embed a video in your website with controls on, and full screen off, use the following URL:

“https://www.youtube.com/embed/MqNd1xD46VY?controls=1&fs=0”

The video ID in the above examples should be replaced with the Video ID of the YouTube video that you want to embed in the web page.

d8e56e8d11177e32daea8b2f748ea097?s=96&d=wp user avatar&r=g
Shashi Venkatesh
Shashi Venkatesh is a 20 year veteran of the technology industry, having worked with an IT Multinational with clients in the Telecom, Logistics, and Airline industry, working globally across America, Europe, and Asia. He enjoys reading and gaming and is an avid motorsport fan.

Related posts

Latest posts

Windows 10 Search not working – try these 5 fixes

Windows 10 search not working is a vexing issue for many. The Search tool in Windows 10 desktop is handy to search Windows or...

Web Browser Privacy – something you cannot ignore

Web browser privacy is becoming a matter of concern after data privacy policies by the Technology giants came under scrutiny. A browser is your...

How to stop Windows 10 updates

How to stop Windows 10 updates that automatically download and install on your computer? Often, you wish you had a way to stop them...

Sign up for our Newsletter

enter your email and click subscribe!