WordPress makes embedding a YouTube video easy in two different ways, depending on whether you want the quick default or full control over how it behaves.
Method 1: paste the URL directly
In the WordPress block editor, simply paste a YouTube link on its own line. WordPress automatically converts it into an embed block using its built-in oEmbed support, no HTML required. This is the fastest option and works well for a straightforward, default-looking embed.
Method 2: the Custom HTML block, for full control
The automatic embed does not give you control over responsive sizing, the privacy-enhanced domain, start times or hidden controls. For that, add a Custom HTML block (search for “Custom HTML” in the block inserter) and paste a generated embed code directly:
- Build your code with the embed code generator, choosing responsive sizing, privacy mode and any playback options you want.
- Add a Custom HTML block where you want the video to appear.
- Paste the generated code into the block.
- Preview the page to confirm it displays correctly.
A note on the Classic Editor
If your site still uses the Classic Editor, switch to the “Text” (HTML) tab instead of “Visual” before pasting the embed code, otherwise WordPress may strip or alter the raw HTML.
Common WordPress-specific issues
Some security or performance plugins strip iframes or scripts from post content by default. If your embed disappears after saving, check your plugin’s HTML filtering settings, or look for an option to allow iframes from trusted domains like youtube.com and youtube-nocookie.com.
Making it responsive on WordPress
Most modern WordPress themes handle responsive embeds automatically for the block editor’s native YouTube block. If you are using the Custom HTML block with a generated code, make sure you selected the responsive wrapper option in the generator so the video scales properly inside your theme’s content column.