Learn how to add video to a post or page. WordPress supports video embeds from a number of video services including YouTube, Vimeo, Flickr, Hulu, and Instagram. This makes it easy for you to add video content to your site without the need to host video files. Should you need to host your own video, WordPress offers that service at an additional cost.
- [Voiceover] More and more these days, folks are creating their own YouTube channels, and companies are creating promotional videos. Whether you have your own videos, or just want to share others you find interesting, WordPress makes that easy to do. WordPress supports video embeds from a number of video services, including YouTube, Vimeo, Flickr, Hulu, and Instagram. They also include support for a number of other video services. To be clear, this embed capability is only for showing videos from these other services.
If you want to upload and host your own video files on the site, you can do that with something called VideoPress, which is included with the WordPress.com Premium, or WordPress.com Business Plans. There are several places you can add videos to your WordPress.com site. Posts and pages you might expect, but you can also use videos in widgets, and in comments. We haven't really talked about widgets yet, but these are small blocks that perform a specific function. You can add them in sidebars, or other areas of a page, as determined by your theme.
We'll get into more detail on this later. For now, using a YouTube video as an example, I'd like to walk you through how to embed a video in each of these four areas. Let's start with posts. I'll head back to my site, and add a new post. Now, we're in the post editor, and I'll give this post a title, and a little bit of content. While I'm at it, I might as well add it to a category while I'm here. Okay, now I'm ready for my video. The easiest way to embed a video is to copy the video URL from your web browser's address bar, while you're viewing the video, and then paste it into the page.
Seriously, it's that simple. Let's try it out. I already have a YouTube video picked out. I'll copy the URL, note, this needs to be the full-length from the address bar, and not the video URL short link, in order for this to work. I'll go back to my post, and paste in the URL, voila! The video just appears. Until recently, you'd at least need to be in the post preview-mode to see the video, but now you can see it right here in the post editor, and that's pretty awesome. If you run into any trouble here, be sure you're only pasting in the URL, versus creating a link out of the URL.
So, that's the simplest, and most straightforward way, to embed a YouTube video. I'll go ahead and publish this, and then we'll take a look at pages. We'll get into more detail of working with pages later, but for now, just note that the process is quite similar to post. I'll start by going back to my site, and by pages, click add. I'll start by giving it a title. Embedding a YouTube video works exactly the same for pages as it does for posts, but there's more than one way to embed a video, and I'd like to show you the second method.
That method is using a short code. The short code method is really cool, as it provides you some customization options that you don't get if you're just pasting the link. The basic short code syntax is this: opening square bracket, YouTube, the link, and then a closing square bracket. You'll notice that this time the video doesn't appear, unless we go and preview the page. That's because we need to see the short code in order to add some customizations. Of course, even if the video did appear, we could always switch over to the HTML editor to get to our short code.
To see the available customization options here, I'm gonna cheat and go look at the WordPress documentation. They have a full page dedicated to videos. I'm gonna go ahead and click on YouTube. So, in addition to that default embed, I can see here that we can specify the width and the height explicitly, specify the width only, left or right align the player, hide related videos from appearing after the video is done, start at a certain point in the video, show just a clip, or hide the top information bar.
For this video, I'm gonna specify a custom width and height. Using the syntax here, as a guide, I can see that after the YouTube URL there's an ampersand followed by a W, equals a number of pixels, another ampersand and a H, for height, equals a number of pixels. Now, if I click video, I can see the custom video size. So, definitely don't worry about memorizing all of that short code syntax, just head over to the WordPress.com support docs anytime you need a reference.
- Creating a WordPress.com account
- Updating your profile
- Importing content
- Publishing posts
- Applying categories and tags to posts
- Inserting images, videos, and other media
- Creating a new page
- Customizing your site with themes and widgets
- Managing users, notifications, and comments
- Using WordPress.com apps
- The limits of WordPress.com and the benefits of self-hosting