YouTube videos can easily be embedded into posts, pages and in widgets.

Embed with a URL

The fastest way to embed a YouTube video is to use the video URL from “Share this video” under the Share option. Only public and “unlisted” videos and playlists can be embedded; “private” videos will not embed.

Video URL

The link will automatically convert into an embed and provide a live preview in your editor.

Video embedded in block editor

If the content can’t be embedded using the URL it loads the embed block in the block editor where you are given an option to try again or convert to a link.

In the classic editor it will be added as the URL if the content can’t be embedded.

Classic editor

The link must be on its own line without any characters or whitespaces before or after the URL and must not be hyperlinked (clickable when viewing the post) otherwise it won’t embed.

Using Embed Code

You can also embed videos using their embed code.

This is handy when you want to change the size of the video embed or change the start time of the video.

Click on Share underneath the YouTube video you want to embed.

Click on Share

Now click on Embed.

Click on Embed

Copy the embed code.

How you add embed code depends on if you are using the block editor or the classic editor.

Block Editor

Add a custom HTML block if you are using the block editor.

To add custom HTML block you click on the + icon at the right of any empty block or at the top left of the editor then search for HTML and click on the custom HTML block icon.

Add custom HTML block

Here’s what it looks like when it’s added to the Block Editor.

Add Custom HTML block

Paste the embed code into the custom HTML block.

Paste embed code

Click on Preview to view the video.

Click on  Preview

Classic Editor

Your Add Media button on your classic editor is used to add embed code to a post or page.

Place your cursor where you want the the video to appear and then click on the Add Media button.

Add Media

In the Add Media window click on the Insert Embed Code tab.

Click on Insert Embed code

Paste the video embed code into the embed code field.

Paste embed code

Click on Insert into Post.

Your Add Media window will close and video will appear as an embed.

Video will appear in post editor