YouTube Embed Guide: Complete 2026 Setup & Parameters
Getting the embed code takes ten seconds. Getting it right takes knowing which parameters actually still work, and that the default embed can quietly cost your page 2MB and a worse Core Web Vitals score before anyone even presses play.
Most YouTube embed tutorials teach the same three clicks — Share, Embed, Copy — and stop there. That part hasn't changed in years. What has changed, repeatedly and quietly, is which of the parameters people still copy-paste from 2019-era blog posts actually do anything anymore.
This covers the current embed process, exactly which parameters still function in 2026 versus which ones are dead weight in your URL, how to make the embed responsive, and the one performance issue almost no basic guide mentions: a standard YouTube embed can meaningfully hurt your Core Web Vitals score before a single visitor clicks play.
To embed a YouTube video: open it, click Share → Embed → Copy, then paste the iframe code into your page. Two commonly recommended parameters are dead — modestbranding was deprecated in August 2023 and does nothing, and rel=0 has only limited related videos to the same channel since September 2018, not removed them. For performance, standard embeds can add 1.3–2.6 MB and 20+ requests before playback even starts, which hurts LCP and INP — the fix is a click-to-play "facade" placeholder that loads the real player only when clicked.
Basic Embed Steps
Get the embed code
Open the video on YouTube, click Share below the player, select Embed from the options, then click Copy to save the HTML iframe code.
Paste it into your site
Drop the copied iframe directly into your HTML source, a CMS embed block, or a WordPress custom HTML block, then save and publish.
Confirm embedding is allowed
If the embed shows an error, check the video's Advanced Settings in YouTube Studio to confirm "Allow embedding" is turned on — most videos have it on by default unless the uploader specifically disabled it.
Parameters That Actually Work in 2026
Append these to the embed URL after a ?, joining multiple with &. All of these are confirmed current in YouTube's own IFrame Player API reference.
| Parameter | What it does | Example |
|---|---|---|
| autoplay | Starts playback automatically (needs mute=1 in most browsers) | autoplay=1 |
| mute | Starts the video muted | mute=1 |
| controls | Shows or hides player controls | controls=0 |
| start / end | Sets playback start and stop time in seconds | start=15&end=90 |
| loop + playlist | Loops a single video (needs playlist set to the same ID) | loop=1&playlist=VIDEO_ID |
| playsinline | Plays inline instead of fullscreen on iOS | playsinline=1 |
| hl | Sets the player interface language | hl=es |
| cc_load_policy | Shows captions by default | cc_load_policy=1 |
| enablejsapi | Required before any JavaScript player API calls will work | enablejsapi=1 |
| list + listType | Embeds a full playlist instead of one video | listType=playlist&list=PLAYLIST_ID |
Parameters That Stopped Working (But Are Still Everywhere)
This is the part most embed guides skip, and it's why so many sites still carry parameters doing absolutely nothing.
Per Google's own IFrame Player API reference, this parameter is officially deprecated and has no effect. The player now decides its own branding based on size and other signals. If a tutorial tells you this removes the YouTube logo, it hasn't been updated in three years.
Before 2018, rel=0 removed related videos entirely. Today it only restricts suggestions to videos from the same channel as the one just played. There is no current parameter that hides end-of-video suggestions completely.
showinfo stopped hiding the video title back in 2018. theme and autohide are both ignored entirely on the current HTML5 player. Delete all three if you find them in older embed code — they're pure noise in the URL.
Making the Embed Responsive
A fixed-width iframe breaks on mobile. The classic fix uses a padding trick to force a 16:9 ratio at any screen size — modern CSS offers a simpler one-line alternative too.
aspect-ratio property is cleaner code but only works in modern browsers — check your site's actual visitor base before relying on it alone.Privacy-Enhanced Mode
Standard YouTube embeds set tracking cookies the moment the page loads, which can be a compliance problem under GDPR-style cookie-consent rules for sites with EU visitors.
Replace youtube.com with youtube-nocookie.com in the embed's src URL. This prevents YouTube from storing cookies on a visitor's browser until they actually press play — everything else about the embed works exactly the same.
The Performance Problem (And the Fix)
This is the part almost no basic embed tutorial covers, and it's the single biggest information gap for anyone embedding video on a content-heavy or commercial page.
Standard embed cost
loading="lazy" alone
Show a lightweight static thumbnail image styled to look like the video player, with a play button overlay. Only load the actual iframe when a visitor clicks it. This means near-zero cost for visitors who never press play, and full playback for those who do — the open-source lite-youtube-embed component implements this in a few lines and is roughly 224x lighter than a standard embed until clicked.
Facade pattern vs. standard embed
The video still plays exactly the same once clicked — the difference is entirely in what loads before anyone asks for it.
Troubleshooting Common Errors
- "Video unavailable" or blank player: the uploader has disabled embedding in YouTube Studio's Advanced Settings for that specific video
- Age-restricted videos: cannot be embedded on external websites at all — this is a hard platform restriction, not a settings toggle
- Works in some countries, not others: the uploader or a rights holder has applied a regional block that also affects embeds in those regions
- Autoplay silently fails: almost always a missing
mute=1alongsideautoplay=1— browsers block unmuted autoplay by default - API calls not firing: check that
enablejsapi=1is present in the embed URL before any JavaScript player control will work
Need the video ID or a thumbnail image first?
Grab the exact video ID or download a clean thumbnail image for your facade placeholder in seconds.
Frequently Asked Questions
How do I get the embed code for a YouTube video?
Does modestbranding=1 still hide the YouTube logo?
Does rel=0 hide related videos at the end of an embed?
Why does autoplay not work on my embedded YouTube video?
How do I make a YouTube embed responsive?
What is YouTube's privacy-enhanced mode?
Do YouTube embeds actually slow down my website?
How do I embed YouTube without hurting Core Web Vitals?
Why does my embedded video say "video unavailable"?
Can I embed a full YouTube playlist instead of a single video?
The embed code itself was never the hard part — three clicks gets you there. What actually separates a clean implementation from a sluggish, cookie-firing, half-broken one is knowing which parameters quietly stopped working years ago, and treating the iframe's page-weight cost as a real design decision rather than something YouTube handles for you.