Videos are a great way to diversify your content, bring life to your website as well as attract and engage new visitors.
Embedding videos to your WordPress website could improve your rankings with Google Search too.
By default, WordPress allows you to embed videos from popular video services such as YouTube, Facebook, Vimeo, Twitter and other platforms very easily.
In this article, we’ll teach you how to embed videos in your WordPress posts, pages, and sidebar widgets easily.
We’ll use YouTube as an example in this guide; however, the steps are similar for other video platforms too.
Embedding videos in posts and pages
oEmbed method
WordPress uses the oEmbed protocol (also known as auto-embed) to automatically parse the embed code you get from popular video hosting services.
This is convenient because it means you don’t need any coding expertise to insert videos in your WordPress posts or pages.
Here are the quick steps:
- Visit YouTube and find the video you want to embed
- Hover your mouse pointer over the URL bar and copy the video URL
- Log in to your WordPress dashboard and create a new page/post or edit the existing one
- Paste the URL you copied previously, and WordPress will automatically parse it and embed the video
Here’s how it looks in the WordPress Gutenberg editor:
And this is how it looks on the WordPress Classic editor:
As you can see, as soon as you paste the video URL – WordPress automatically fetches the embed code and displays the video inside your editor.
If you use the Gutenberg editor, WordPress allows you to add a caption, change alignment, resize your video for smaller devices, etc.
Once you preview or publish your post/page, you will see the embedded video published:
It’s really a piece of cake!
Keep in mind that WordPress auto-embeds URLs only for particular video services. For any other video services/website, you need to obtain the full embed code.
Here is a list of websites/services WordPress can automatically embed videos from:
- Amazon
- CollegeHumor
- Dailymotion
- Flickr
- Hulu
- Imgur
- Kickstarter
- Mixcloud
- ReverbNation
- Slideshare
- Scribd
- Screencast
- SoundCloud
- Spotify
- Tumblr
- TED
- Vimeo
- VideoPress
- WordPress plugin directory
- WordPress.tv
- YouTube
For any other website, copy the HTML code and in Gutenberg editor, search for a Custom HTML block and add it to the page:
Once added, paste the embed code into the box as shown below:
iFrame method
The alternative method allows you to customize how your video will show on your page or a post. Find the video you want to embed on YouTube and click the Share option above the Subscribe button:
Click Embed:
Adjust the options you’d like and copy the HTML code:
In the WordPress visual editor, change from Visual to Text mode and paste the code:
Embedding videos in sidebar widgets
As mentioned, WordPress also allows you to embed videos to the website sidebar widgets in addition to posts and pages.
Gutenberg editor
Head to Appearance > Widgets and add the Video widget to the desired sidebar:
Click the Insert from URL button and paste your video URL inside the box:
You will see the preview and options to change the alignment, resize the video for mobile devices, etc.:
Click the Update button in the top-right corner to save changes.
Here’s how the video looks on our test website:
Classic editor
Head to Appearance > Widgets and add the Text widget to the desired sidebar. Fill in the title and paste the video URL to the content area:
Click Save to save changes.
Here’s how it looks on our website:
That’s it!
Third party plugins
The WordPress auto-embed feature is fantastic, but it comes with limited options. Here are some recommended third-party plugins that allow further customizations.
YouTube embed plugin
YouTube Embed is perfect for people that frequently upload videos to YouTube as it allows you to create playlists, choose how to play them, and use dynamic video resizing features. The plugin also supports turn off the lights feature and streaming videos through Chromecast.
Price: Free
Video embed and thumbnail generator plugin
This free plugin turns your regular website into a video website. It provides a plethora of different video players you can use, automatically generates video thumbnails, and has plenty of settings to customize how your videos display.
Price: Free
Lazy load for videos plugin
Each video embed on your website affects the performance as it loads scripts from external websites. Lazy Load for Videos prevents this by displaying the static image and only loading the embed code once the visitor clicks the play button. In addition to that, it provides tons of customization options for your YouTube and Vimeo video players.
Price: Free
Conclusion
You should avoid uploading videos to your website directly as it can negatively affect your WordPress website performance. Additionally, uploading to YouTube is beneficial as it’s the third most visited website globally, and it can generate tons of visitors and traffic to your content. It’s also a great way to create a natural content loop for your audience between your website and video channels across platforms.