Tags – , ,

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

YouTube is by far the most popular video sharing platform, with 300 hours of content uploaded every minute. WordPress makes it easy for you to harness this incredible content source and show YouTube videos straight into posts and pages.

In this post, we’ll show you everything you need to know.

Let’s get started…

Select your YouTube video

Before you can show a YouTube video on your site, you need to find the video you want to add.

Copy the YouTube video URL.

(click to enlarge)

You’ll then need to click Share and copy the video URL (as shown above). If the video you’ve selected is part of a playlist you’ll have the option to show just the current video (untick the playlist box), the whole playlist and whether to show from the start of the playlist or the current video.

Add a YouTube video to a WordPress post or page

Now head to your WordPress Dashboard. You can create a new post or page, or edit one already created. The process is identical for posts and pages, so it doesn’t matter which you’re using.

Your video will need to be on a new line, so if you’re adding a YouTube video to already-existing content, hit return where you want the video to go.

Paste the YouTube URL on a new line.

(click to enlarge)

Paste in the YouTube video URL you just copied on the new line. There’s no need for the URL to be a hyperlink (linking the URL will stop the video from showing) – literally just the link you copied from YouTube is all you need.

If you have the free Jetpack plugin installed you’ll get an instant preview of the video. Otherwise, save your post or page as a draft (or update for already-published) and you’ll get the full preview displaying.

Publish or update your post or page and you’re all done!

Manual WordPress video embeds

If the magic pasting of the video on a single line doesn’t work or you want more control over YouTube’s video player, you’ll need to embed the video manually.

Fortunately, WordPress makes this easy.

Again, find the video you want to embed on YouTube. This time, however, select the Embed tab below the video and then Show More. You now have some extra options you can customise:

  • Width of the video player (choose from pre-sets or use a custom size).
  • Toggle showing suggested videos when video finishes.
  • Toggle YouTube player controls.
  • Toggle showing video title and top-right sharing links.
  • Turn on privacy-enhancing mode.

You can also manually customise parameters. Google shows all the options available here.

Choose any options for your YouTube embed and copy the code.

(click to enlarge)

Once you’re done customising any options, copy the embed code (you’ll find it starting <iframe...).

You can now paste your embed code into your WordPress post or page. This part is a little different to pasting the URL: you’ll need to go to Text mode on the WordPress editor. This lets you add some HTML, including YouTube embed code.

Again find where you want to add your video, but this time add two line breaks – so there’s one either side of where you will show your video. Paste in the embed code in the middle line and switch back to the Visual tab. You’ll now see a preview of your video.

Paste your YouTube embed code.

(click to enlarge)

Update or publish your post and you’re done!

Add really good YouTube video content

Adding YouTube videos to your WordPress site is a really powerful way of keeping visitors better engaged and on your site longer. With the two methods shown here, we’ve equipped you to do just that.

Tweet about this on TwitterShare on FacebookGoogle+Share on LinkedInEmail to someone

By Alex Denning

Alex Denning is a WordPress power user, freelancer and writer. He's been writing about WordPress, making documentation and video screencasts for the last eight years. You can read his weekly blog here.
Comments (policy)
  • I have a question about how to justify the video, meaning put it into content like you would an image, right or left.

    • Hi Milly, to do this you need to embed your video at less than full width, so use the manual method above and set the video size to less than the width of your content area. You can then paste in Text mode, as shown above, but need to add class=”alignleft” (change left for center or right to align to those sides) to the iframe to add alignment.

      For example:

      That will align your video. Enjoy!

More in Quick Tips
How To Enable GZIP Compression For WordPress

If you've been working with computers for any real length of time, you'll likely already be familiar with compression. For those who aren't: compression is...

Close