Tools
How to embed a YouTube video with autoplay, start time, and privacy
How to get a YouTube embed code and customise it with start times, muted autoplay, looping and privacy-enhanced mode, plus how to make the player responsive on mobile.
Short answer
The short answer
To embed a YouTube video, click Share under the video, choose Embed and copy the iframe code. Add parameters to the src address to change how it plays, such as start=90 to begin at 90 seconds or autoplay=1&mute=1 for muted autoplay, and use the youtube-nocookie.com domain for privacy-enhanced mode.
The standard way to get an embed code on YouTube
Follow these quick steps on desktop to grab the basic HTML embed code directly from any video.
Useful YouTube iframe embed parameters explained
Add these parameters to the iframe src address. YouTube's player parameter reference documents start, autoplay, controls, loop and rel.
| Parameter | Example Syntax | Function | Important Rule |
|---|---|---|---|
| Start Time | ?start=90 | Begins video playback at a specific second count (90 seconds). | Must be expressed in total seconds, not minutes and seconds. |
| Autoplay & Mute | ?autoplay=1&mute=1 | Starts video immediately when the web page loads. | Browsers usually block autoplay with sound, so add mute=1. |
| Player Controls | ?controls=0 | Hides the bottom control bar, timeline scrubber, and volume slider. | Hides the control bar; useful for background loops. |
| Loop Video | ?loop=1&playlist=VIDEO_ID | Repeats playback continuously from the beginning upon finishing. | YouTube's docs say a single video needs playlist set to the same ID, and loop support in embeds is limited. |
| Related Videos | ?rel=0 | Restricts end-screen suggested videos to your channel only. | Since 2018, rel=0 shows related videos from the same channel, not zero videos. |
| Privacy Mode | youtube-nocookie.com/embed/ | Prevents tracking cookies from being placed before playback. | Helps with privacy, but isn't a substitute for a proper cookie consent setup. |
Browser autoplay rules: why videos must be muted
Understanding browser media policies prevents broken embeds that fail to play.
What is privacy-enhanced mode and why should you use it?
When you embed a standard YouTube video using the youtube.com domain, YouTube can set cookies on the visitor's device as soon as your page loads, even if they never press play. For site owners operating in the European Union, United Kingdom, or jurisdictions with strict cookie consent regulations like GDPR and the ePrivacy Directive, loading third-party tracking cookies without prior consent can create a compliance problem.
Checking 'Enable privacy-enhanced mode' swaps the standard domain for youtube-nocookie.com, which limits what YouTube stores about a visitor until they play the video.
Privacy-enhanced mode is completely free, maintains identical video playback performance, and requires zero extra code beyond swapping the domain. Turning it on by default is good practice.
How to make YouTube embeds responsive on mobile
Standard iframes come with fixed width and height dimensions that overflow mobile screens.
Do embedded YouTube views count toward your channel statistics?
Yes, views generated through embedded players count toward your public YouTube view counts and watch hours, provided the playback is initiated genuinely by a real viewer. When a visitor lands on your blog and clicks play on your embedded video, YouTube logs the view just like a view on the main website.
However, YouTube fraud detection algorithms filter invalid traffic. If you create an autoplaying embedded video that loops invisibly in an iframe or use bots to repeatedly refresh a web page, YouTube invalid traffic filters strip those views from your analytics. Artificially inflating views through deceptive embeds risks demonetization under YouTube Fake Engagement Policy.
Legitimate embeds on popular blogs, educational portals, and partner sites represent high-quality traffic. They bring real viewers who chose to watch.
Free tools
Tools for this
Free, no signup and no email. Each one covers something this post just described.
FAQ
Common questions
To make an embed autoplay, append both ?autoplay=1 and &mute=1 to the iframe source address. Modern browsers automatically block unmuted autoplay to protect user experience.
The youtube-nocookie.com domain is YouTube's privacy-enhanced mode. It limits what YouTube stores about visitors until they play the video, which helps with privacy rules, though it doesn't replace a cookie consent setup.
Yes. Legitimate views generated through embedded players count toward your channel total view count and watch time, provided they are watched by real users and not generated through hidden or fraudulent autoplay loops.
Apply CSS styling to the iframe by setting width to 100 percent and aspect-ratio to 16 / 9. This ensures the video expands to fill mobile screens without cropping or creating horizontal scrollbars.
Not completely. YouTube's docs say that since September 2018 you can't disable related videos. Setting rel=0 limits them to videos from the same channel as the one that just played.
Keep reading
Related posts
Put it into practice
Start with 1,000 free views on any public video, or run a campaign from $0.10 per 1,000 views. No password, nothing added at checkout.
