This article was originally published on this site


WordPress Deals

Videos are a fantastic way of enriching your website content and keeping visitors on your pages 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 will show you how you can integrate YouTube videos into your WordPress posts, pages and custom post types.

Whilst YouTube is the primary focus of this tutorial, please be aware that the steps outlined below will 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

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

I will 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 that is displayed underneath YouTube videos.

YouTube Share Button

The YouTube share box lists the video URL and gives you the option of sharing the video on around a dozen social media platforms.

There is also an option to start the video at a specific point.

The YouTube Share Box

If you click on the embed button, YouTube will display 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 in order 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 are ready to publish the video on your website.

Displaying a YouTube Video – The Quick Way

When you are using the WordPress editor, you will 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 is the quickest and easiest way to add a YouTube video into 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 that copying and pasting the video URL into your content area will also work when using the WordPress Classic Editor.

Displaying a YouTube 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 at 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 have embedded a video, an edit URL button 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 will 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.

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.