How to Show a YouTube Video in a WordPress Post or Page

WordPress Deals

Videos are a fantastic way of enriching your website content and keeping visitors on your pages for longer.

There are many video services online, but YouTube is by far the largest — hosting millions of videos and delivering billions of hours of video content every day.

In this article, I’ll show you how you can integrate YouTube videos into your WordPress posts, pages and custom post types.

While YouTube is the primary focus of this tutorial, please be aware that the steps outlined below will also work with other video platforms, such as Vimeo, Facebook and DailyMotion.

Check out the WordPress embed page for a complete list of which video and image platforms are supported by WordPress.

Find the Video URL

To display a video on your website, you need to know its URL.

I’ll use the WinningWP YouTube channel as an example.

If you view our video ‘How To Make a Squarespace Website‘ (full article), you can see the URL of the video at the top in the browser address bar.

YouTube Video URL

Simply highlight this URL and click to copy.

Copy the Video URL

You can also retrieve the video URL by clicking on the share button displayed underneath a YouTube video.

YouTube Share Button

The YouTube share box lists the video URL and gives you the option of sharing it on around a dozen social media platforms — and there’s also an option to start the video at a specific point.

The YouTube Share Box

If you click on the embed button, YouTube will show the HTML code for displaying the video in an iframe.

Since YouTube automatically inserts the necessary HTML code for videos into posts and pages behind the scenes, you only need the URL of a video to display it on your website.

You can, however, use the iframe HTML code to integrate videos directly into WordPress page templates.

YouTube Video Embed Code

Once you have the video URL, you’re ready to publish the video on your website.

Displaying a YouTube Video — The Quick Way

When you’re using the WordPress editor, you’ll see a message that states ‘Start writing or type / to choose a block’.

Start Writing on WordPress

If you paste the YouTube video URL into this box, WordPress will automatically add the video into your content using the YouTube block.

It’s the quickest and easiest way to add a YouTube video to your website, and the YouTube block allows you to adjust the alignment of your video and display a caption underneath.

Copy and Paste Video URL

WordPress’s support of the oEmbed protocol means copying and pasting the video URL into your content area will also work when using the WordPress Classic Editor.

Displaying a Video With the YouTube Block

Copying and pasting a YouTube video URL into the WordPress editor will automatically create a YouTube block using the video URL.

If you prefer, you can add the YouTube block manually.

One way to do this is to simply type a slash (/) to see a list of available content blocks, and then select YouTube.

Enter a Slash

Alternatively, you can insert a YouTube block into your content area by clicking on the + symbol on the top-left hand side of the editor, and then selecting the YouTube block from the embed section.

You can also find the block by searching for YouTube in the content block search bar.

Add a YouTube Block

The YouTube block is simple to use.

All you have to do is enter the URL of the YouTube video you want to insert into your content, and then click on the embed button.

Enter YouTube Video URL

Once you’ve embedded a video, an edit URL button is displayed above. Clicking on this will take you back to the section where you enter the video URL.

The Genius of WordPress

The WordPress block editor is extremely intuitive.

If you enter a YouTube video URL into a WordPress embed block or video block, it’ll change the block to a YouTube block for your video.

Embed a Video

WordPress does this with other video platforms too.

For example, if you enter a DailyMotion video URL by copying and pasting the URL, or by using an embed block or video block, WordPress will change it to a DailyMotion content block.

Dozens of video and image platforms support this feature.

Final Thoughts

WordPress has fantastic support for YouTube and other video platforms.

The developers of WordPress have simplified the process of integrating videos into your website by supporting copy and paste. However, you can still insert videos directly using content blocks if you prefer.

By Kevin Muldoon

Kevin Muldoon is a professional blogger with a love of travel. He writes regularly about internet marketing on his personal blog and actively talks about technology on YouTube.
Comments (policy)

Leave a Reply

Your email address will not be published. Required fields are marked *

All comments are held for moderation. We'll only publish comments that are on topic and adhere to our Commenting Policy.