YouTube Embed Not Working? Fix Errors 150, 101 and 153
Diagnose disabled embedding, missing referrers, blocked iframes, and autoplay restrictions without weakening your site security.

Tool Free
Thumbnail Downloader
Download YouTube thumbnails in HD quality.
You paste the iframe, publish, and the player shows a grey box, a spinning wheel, or "Video unavailable". Most embed problems come from a short list of causes: embedding disabled by the owner, a blocking security policy, bad markup, or browser autoplay rules. This guide walks through each one in the order you should check them.
Step 1: Identify the error message
The wording in the player tells you where to look.
| Symptom or error | Most likely cause | Fix |
|---|---|---|
| "Video unavailable" with error 150 or 101 | The owner disabled embedding, or it is restricted by rights or age settings | Enable embedding if you own the video, or choose another video |
| Error 153 or "Video player configuration error" | Missing or blocked referrer information | Allow the referrer policy in your iframe or site headers |
| Error 100 | Video removed or set to private | Restore the video or replace the link |
| Error 2 or 5 | Invalid parameter or HTML5 player problem | Check the video ID and URL parameters |
| Blank grey box, no message | CSP, ad blocker, or script blocking the iframe | Allow YouTube in frame-src and test without extensions |
| Plays but will not autoplay | Browser autoplay policy | Add mute=1 with autoplay=1 |
YouTube's error codes are documented in its IFrame Player API reference, and exact behavior can change, so use this table as a starting point and confirm in the official docs when something does not match.
Error 150 and 101: embedding is disabled
Errors 101 and 150 are the same in practice: the video owner does not allow the video to be played in embedded players. This is the most common failure when you embed someone else's content.
If the video is yours
- Open YouTube Studio and select Content.
- Click the video, then choose Show more under the details.
- Check Allow embedding and save.
Also check channel-level defaults under Settings, Upload defaults, Advanced settings, where the embedding option can be pre-set for new uploads. Videos with certain music claims or age restrictions may still refuse to embed, so check the Restrictions column in Studio.
If the video belongs to someone else
You cannot override the owner's setting. Your options are to ask the creator to enable embedding, link to the watch page instead, or use a different video. Do not download and re-upload a video without permission; that raises copyright issues, and the copyright strike guide explains the risks.
Check the iframe markup
A clean, current embed looks like this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" title="Video title" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Common markup mistakes
- Using the watch URL.
youtube.com/watch?v=IDwill not load in an iframe, because YouTube refuses to be framed from that page. Use/embed/ID. - Wrong or truncated video ID. It is 11 characters. Copy it directly from the Share menu.
- Missing
allowattributes. Features such as fullscreen, encrypted media, and picture-in-picture are permission-gated. Delegate fullscreen withallowfullscreenor the fullscreen Permissions Policy token. Permissions can also be restricted by the parent page’s Permissions-Policy; an iframe allow list cannot override that policy. - Overly strict
referrerpolicy. Settingno-referrercan trigger a configuration error because YouTube expects referrer information.strict-origin-when-cross-originis the safe choice. - Opening the page as a local file. Testing from
file://sometimes triggers errors because no valid origin is sent. Use a local server or a staging URL. - A site editor that strips iframes. Some CMS plugins and email tools sanitize iframe tags. Use the platform's native YouTube block or an HTML-capable block.
If you would rather not write it by hand, the Embed Code Generator produces valid iframe code with the correct attributes. For the basic embedding workflow, see how to embed a YouTube video on your website.
Autoplay needs mute
If autoplay=1 does nothing, it is almost certainly a browser policy, not a bug. Chrome, Safari, and Firefox block unmuted autoplay unless the user has interacted with the site. A commonly supported request is:
src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1&mute=1"
Add playsinline=1 so iOS does not force fullscreen, and keep allow="autoplay" on the iframe. Autoplaying with sound on page load also hurts user experience, so consider a click-to-play thumbnail instead.
Privacy-enhanced mode: youtube-nocookie.com
If you are embedding under a privacy regime such as GDPR, use the privacy-enhanced domain:
https://www.youtube-nocookie.com/embed/VIDEO_ID
Privacy-enhanced mode limits how embedded views are used for personalization. Do not interpret the domain name as a guarantee that no storage, network requests, or data processing occur. It does not mean zero tracking after the click, and it does not replace a consent banner if your legal advice says you need one. One practical gotcha: if you switch domains, your CSP and any consent-manager rules must also allow youtube-nocookie.com, or the player will show up blank.
CSP and frame-src: the silent blocker
If the page shows an empty box and your browser's console has a message like "Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive", your site's CSP is blocking the iframe. Add the selected embed origin to frame-src. When absent, browsers consult child-src, then default-src:
Content-Security-Policy: frame-src 'self' https://www.youtube.com https://www.youtube-nocookie.com;
If you load the IFrame Player API script, also allow it in script-src (https://www.youtube.com), and allow thumbnails in img-src (https://i.ytimg.com). Also check for an X-Frame-Options header on your page; that affects whether others can frame you, not YouTube's embed, so it is rarely the culprit here.
Other causes worth testing
- Ad blockers and privacy extensions. Open the page in a private window with extensions disabled.
- Consent managers. Many cookie banners replace iframes with placeholders until consent is given. If the placeholder never clears, the issue is in the banner configuration.
- Lazy-loading scripts. A
loading="lazy"iframe inside a hidden tab or accordion may fail to initialize in some themes. Test with it removed. - Responsive wrapper bugs. A parent with zero height collapses the player. Use
aspect-ratio: 16 / 9; width: 100%on the iframe. - Region or age restrictions. The video may play in your country but not the visitor's. Check from another network.
- Live streams and premieres. An upcoming premiere can show an unavailable state before it begins.
Tip: Test a known embeddable video in the same iframe on your staging page. If it works, investigate the original video’s permissions. If neither works, inspect your page configuration. Opening the embed URL directly is not conclusive because that request may lack the referrer required by YouTube.
A quick checklist before you publish
- Embedding is allowed in Studio, and the video is public or unlisted.
- The
srcuses/embed/with a valid 11-character ID. - The iframe has a meaningful
title, theallowlist, andallowfullscreen. - Your CSP allows
frame-srcfor the YouTube domain you chose. - Autoplay, if used, includes
mute=1. - The player was tested on mobile, in a private window, and from a staging URL.
Legitimate embedded playback can contribute to channel engagement, though monetization eligibility rules distinguish valid public watch hours from other watch time, so a working player helps both your site and your channel. Once playback is fixed, a clean thumbnail and title on the page make visitors more likely to press play, and the Thumbnail Heatmap (design feedback tab) can help with that.
Use browser evidence instead of guessing
Inspect the published page, not only the editor
Open developer tools on the actual failing page and reload with the Console and Network panels visible. Look for a refused frame, a blocked request, or a rewritten source URL. A CMS preview can run inside another iframe with its own sandbox and permissions, so failure in preview does not necessarily mean the published page is broken.
Separate referrer errors from origin settings
Error 153 means the player request lacks an HTTP Referer or equivalent API client identification. Check for a site-wide no-referrer policy, privacy tooling, or an application webview that suppresses that information. Setting the iframe's referrerpolicy to strict-origin-when-cross-origin is a useful browser baseline, not a universal override for every host environment.
If you use enablejsapi=1, supply the origin parameter with your page's exact scheme and host, including a nondefault port when applicable. This identifies the JavaScript API caller; it is not a substitute for fixing missing referrer information. Never add random origin values copied from another site's code.
Preserve security while narrowing the cause
Do not solve a CSP error by replacing your entire policy with a wildcard. Merge the required frame origins into the existing policy and check every enforced CSP header or meta policy: multiple policies all apply, so a second restrictive policy can still block playback. The parent page generally does not need to allow every media endpoint used inside YouTube's cross-origin player.
A sandbox attribute introduces another set of restrictions. Scripts, presentation, and origin handling can behave differently inside a sandboxed iframe. Compare with YouTube's official embed on a controlled staging page, then restore only the restrictions your implementation can support. Do not weaken unrelated site protections in production just to hide an error.
After isolating the cause, regenerate a baseline with the Embed Code Generator and reapply custom options one at a time. If the video itself shows a rights restriction, the Checks step in YouTube Studio can support your review, but it cannot change a rights holder's settings or authorize embedding.
Frequently asked questions
Why is my YouTube embed not working?
Common causes include disabled embedding, a private or removed video, missing referrer information, blocked iframe requests, and CMS sanitization. Use the player error and browser console to narrow the cause.
How do I fix YouTube embed error 150 or 101?
Both codes indicate that the owner does not allow embedded playback. If you own the video, check Allow embedding in Studio. Otherwise ask the owner or use another video; iframe parameters cannot override it.
How do I fix YouTube error 153?
Check whether the page, browser extension, or hosting environment suppresses the HTTP Referer or equivalent client identification. Use a normal HTTPS test page and an appropriate iframe referrer policy such as strict-origin-when-cross-origin.
Why does my YouTube iframe not autoplay?
Browsers generally restrict autoplay with sound. Request autoplay=1 and mute=1 and delegate autoplay permission on the iframe. Browser settings, parent policies, and power-saving modes can still prevent it.
Does youtube-nocookie.com fix all privacy requirements?
No. Privacy-enhanced mode changes personalization behavior, but it does not guarantee zero data processing or remove every consent obligation. Configure your consent manager and CSP for the selected domain and assess your legal requirements.