Embedding a YouTube video or playlist allows you to display it directly on a website or blog. This is done using an HTML embed code that you copy from YouTube and paste into your site.
How to Embed a Video or Playlist
On a computer:
- Go to the YouTube video or playlist you want to embed
- Click Share
- Select Embed
- Copy the HTML code shown in the box
- Paste it into your website’s HTML
Privacy & Technical Notes
- The YouTube embedded player is governed by the YouTube API Terms of Service and Developer Policies
- Websites that embed YouTube content may need to allowlist YouTube domains in firewall settings
- Age-restricted videos usually cannot play on external websites and will redirect users back to YouTube
Privacy-Enhanced Mode
You can embed videos in a more privacy-focused way that reduces tracking and personalization.
How to enable it:
Replace:
with:
https://www.youtube-nocookie.com
Example change:
- Standard embed:
https://www.youtube.com/embed/VIDEO_ID - Privacy-enhanced embed:
https://www.youtube-nocookie.com/embed/VIDEO_ID
This mode:
- Limits personalization of ads and recommendations
- Reduces how embedded views affect YouTube browsing behavior
Customizing Embedded Videos
Autoplay a video
Add autoplay=1:
https://www.youtube.com/embed/VIDEO_ID?autoplay=1
Note: Autoplayed videos typically do not count as standard views.
Start video at a specific time
Use start=SECONDS:
Example (start at 1:30):
https://www.youtube.com/embed/VIDEO_ID?start=90
Turn captions on automatically
Add:
cc_load_policy=1
To set a language (example: French):
cc_lang_pref=fr&cc_load_policy=1
Disable Embedding on Your Videos
If you don’t want others to embed your video:
- Open YouTube Studio
- Go to Content
- Select the video and open Details
- Click Show more
- Uncheck Allow embedding
- Click Save
Important Technical Requirement
Embedded videos must be loaded through a proper website context. If the video is opened incorrectly (for example, directly in a browser without a page), playback may fail due to missing required HTTP information, resulting in an error.
Embedding a YouTube video is done by copying an iframe code from the Share menu and pasting it into a website. You can customize playback (autoplay, start time, captions) and choose privacy-enhanced mode for reduced tracking. You can also disable embedding entirely from YouTube Studio if needed.
