Last updated - August 6, 2024
A few years ago, video was an expensive marketing tool privy to only the biggest agencies and brands. But since then, video has proved its value as an extremely flexible medium with high returns on value.
Today, marketers around the world use video to showcase products and services, help customers, give a human touch to content, and grab more eyeballs. And we regularly see it in action on two of the biggest platforms for content creation and marketing — WordPress and YouTube.
Recognizing this, both platforms have made it incredibly easy for anyone — knowledgeable about coding or not — to embed YouTube videos in WordPress. This blog will explain some of the easiest and most effective methods of embedding YouTube videos in WordPress. And a few tips in the end will let you in on some creative ways to use your YouTube WordPress content.
What is embedding a YouTube video?
You might be familiar with the term “uploading a video” but embedding is not so much. Embedding a video or embedding a YouTube Video Gallery means pulling a URL from the source and displaying it on your website.
Now, the question comes: if that’s the case, we could just upload a video onto the website, so why go with the hassle of embedding? Now, for the website to be responsive, it is necessary to be mindful of the size of the content you upload to the website. Video files are usually of a larger file size and hence can slow down the website to a great extent. Through embedding, we can get two benefits at a shot. One, there is a video element on the website that doesn’t slow down anything.
Before getting into how to embed a YouTube Video Gallery using ELEX, let’s understand how to embed a YouTube video into your website.
Embed YouTube Videos Using the Editor
The easiest way to embed YouTube videos in WordPress in the editor is by using the oEmbed protocol. This lets you embed videos, images, and text from one site to another just by using the source URL.
Here’s how you do it:
- Go to YouTube and find the video you want to embed.
- Select the URL at the top of the browser and copy it entirely.
- Then, go to your WordPress visual editor and place the cursor where you want the video to appear.
- Paste the video’s URL and let WordPress automatically convert it into an embedded video.
Pasting a video URL automatically turns it into an embedded video.
Yes, it’s that easy. Just make sure you keep these guidelines in mind while using the oEmbed method:
- Place the embed link in its line. This means there should be no text or whitespace before or after the link.
- Don’t add alignment or style elements to the URL. This can envelop the URL in HTML formatting and cancel the embed.
- Only links to videos or playlists are accepted. Don’t paste the URL of a YouTube channel.
Using the Editor’s Block Addition Feature
Another way to directly embed YouTube videos to WordPress directly using the editor is by adding it as a block. Let’s take a look at this method now.
In a WordPress post, you can enter text or choose a different type of block.
WordPress Block Editor has the option to embed YouTube videos.
Click the Plus symbol to add a different type of content than a text paragraph, which is the default in the WordPress block editor. You will get a menu showing different types of elements you can add to your post.
The editor has many content types you can add to your posts.
Click on Browse All to find the embedding feature. You can scroll down to the embed section to find the YouTube embed option or use the search bar to find it.
The Block Editor supports the embedding of a lot of popular media hosting services.
Click on YouTube here. Copy the URL of the YouTube video that you want to add to your WordPress post, and paste it here.
The video will now be embedded in your post.
Note that you can embed videos from other sources like Vimeo, Dailymotion, and Twitter. Other sources like Imgur and Flickr can be used to host images, and Spotify can be used to embed music tracks as well. More hosting services cater to even more content types besides them. Play around and find out if you can use these services too, to embed different types of content on your website.
Embed YouTube Videos Using the Iframe Method
While the oEmbed method is simple to follow, it doesn’t give you any customization options to play with. You can’t disable the embedded video’s player controls, nor can you set it on autoplay.
This is where Iframe comes in. This embedding method lets you control exactly how you want the video to look and work on your WordPress website. You’ll have to follow a few extra steps:
- Click on the Share button below the YouTube video you want on your WordPress page.
- Then, click on the Embed button.
- Here, you’ll find the iframe embed code and a few customizable options.
- If you want the video to start at a certain point, pause the video at that point and enable the ‘Start at’ option.
- You can also manage player controls and privacy-enhanced mode just below.
- Next, copy the embed code and head back to your WordPress website.
- Switch from your visual editor to the text editor and paste the embed code.
- Update the post and WordPress will convert it into an embedded video.
YouTube’s iframe embed method offers customizable options.
Embed YouTube Videos Using Online Embed Tools
While the iframe method itself comes with a long list of customization options for embedding videos, YouTube doesn’t include them all. Even the ‘Developer Sample’ section in YouTube is limited to a few extra customization options.
To take advantage of everything the iframe method has to offer, you can try online YouTube video embedding tools like YouTube Video Embed. The website lets you make a long list of customizations and spits out a code you can directly copy into your WordPress text editor.
Just paste the video URL, play around with the embedding options, and copy and paste the iframe code. Here are some embed options you can expect at YouTube Video Embed:
- Autoplay video – Play the video automatically when the webpage opens.
- Loop video – The embedded video plays on a loop repeatedly.
- Show Annotations – Enable or disable text annotations in the video.
- Allow fullscreen – Viewers can or cannot watch the video in full screen.
- Closed captions – Enable or disable closed captions on the video.
- Progress bar – The progress bar is visible throughout the video or auto-hides after a certain time.
- Related videos – Enable or disable YouTube from showing related videos at the end of the video.
- Video title – Control the visibility of the video’s text title.
- Start time – Time at which the video starts.
- End time – Time at which the video ends.
- Layout – The video’s dimensions remain fixed or change according to the screen size.
- Alignment – The video can be aligned to the left, center, or right.
- Aspect ratio – The video’s aspect ratio can be 16:9, 4:3, or 1:1.
- Width and Height – The video’s dimensions in pixels.
YouTube Video Embed lets you make a long list of embed customizations with ease.
While there are other plugins with similar functionalities in the WordPress plugin store, we have found YouTube Video Embed to be a comprehensive tool to get the job done.
Optimizing Embedded Pages
Embedded YouTube videos make up a significant part of a web page’s page weight. This is why performance metrics will show an increase in page load times after you’ve embedded a video. This happens because every time a visitor’s browser has to render your page, several extra requests have to be made.
Requests for multiple resolutions, images, and other assets slow down the page. And if you have two or more videos on your page, all of your page optimization techniques won’t mean much.
An easy solution to this problem is lazy loading your embedded YouTube videos. Lazy loading is a technique that only loads essential resources at page load time. Other less critical resources like embedded videos are only loaded when the user clicks on the play button.
Note: Lazy loading cannot work if the embedded YouTube video is set to autoplay.
Shying away from lazy loading guarantees a waste of user data, processing time, battery time, and other system resources. But with a good lazy loading plugin installed, you can reduce initial page weight, system resource usage, and initial page weight, all of which improve your website performance.
The ELEX Optimize YouTube Videos Embed Plugin for WordPress is a good tool for this purpose. The plugin mimics an embedded video using a preset banner and YouTube icon but only loads embedded videos after the visitor clicks.
You can download the free plugin from Elextensions and install it on your WordPress website. The plugin comes with a shortcode you can use to embed the video. Just supply the video URL and the banner image link and you’re good to go.
The shortcode is: [eh_optimize_youtube_embed video=”VIDEO LINK” banner=”IMAGE URL” alternate_text=”ALTERNATE TEXT” width=”560″ height=”315″]
ELEX’s video optimization tool lets you lazy load videos with a simple shortcode.
Embedding Videos in the Sidebar
A creative way to use YouTube videos in WordPress is to embed them in your sidebar. Instead of populating your sidebar with recent post suggestions in the text form, you can use videos to keep them engaged and on your site. The process of embedding YouTube videos in your sidebar is easy.
Videos in the sidebar are great for catching visitors’ attention.
In your admin dashboard, hover over ‘Appearance’ and click on ‘Customize’. Then, click on ‘Widgets’, choose the sidebar, and click on ‘Add a Widget’.
In the search box, type video and click on the result. The video widget will be added to your sidebar. Now, you just need to ‘Add a video’. Choose ‘Insert from URL’ from the pop-up.
Paste the video link, wait for the video preview, and click on ‘Add to Widget’. Finally, click ‘Publish’ to take it live.
Making a Video Gallery on WordPress
Another creative use of YouTube embeds is making a video gallery on WordPress. If your brand has a dedicated YouTube channel of its own, you can streamline your content marketing efforts by showcasing your entire channel on your website.
Learnwoo’s video gallery showcases its YouTube channel.
You can use plugins like Embed Plus and ELEX WordPress Embed YouTube Video Gallery to make your gallery. These plugins also come with features like zip importing, live streaming, block editor compatibility, and many more to make the process effortless and automated.
To know how to embed a gallery to your WordPress site, check here!
With that, you now know how to embed a YouTube video in WordPress, optimize your webpage, customize your sidebar, and create a video gallery all by yourself. Do reach out to us if you have any relevant questions.
How to embed a YouTube video in place of a WooCommerce Product Image? (Premium Feature)
What if I say that you can replace your boring product images with a full-fledged product video on your WooCommerce site?
For this, you will need a premium subscription to this plugin from ELEXtensions.
- WordPress Dashboard > Products > All Products > Choose one Product’
- Now, you will see a box where you can enter the URL for the proposed product video
- Enter the URL and then click on Update
- This is how it looks in the frontend
Final Wrap
As videos are gaining wider importance, it becomes necessary to learn all the ways mentioned in the blog to amp up your game. Make sure to have the necessary backup of all your data on WordPress before setting on to experimentations.
FAQs
- How can I embed YouTube video in a WordPress post or page?
You can simply paste the URL into the content area and WordPress will recognize it and will automatically embed it to your blog or post. You can also use the video block of the content management system.
- Can I customize the appearance of the embedded YouTube video?
Yes, you can customize the appearance of the embedded videos. Different plugins in the market will help with the best customization.
- Why is it more important to embed videos than to upload them?
Uploading videos can lead to crashing the site and also irritate the users with longer loading times. Therefore, embedding videos can help solve this issue and help you add the video element to your website.
- Which are some of the best YouTube embed plugins?
You can read about the best 6 plugins, here.
- Can I Embed a YouTube playlist on WordPress?
Yes, you can embed a YouTube playlist on WordPress.
Further Reading
- 6 Best YouTube Embed Video Plugins For WordPress
- 8 Simple Steps to Create an Eye-Catchy YouTube Thumbnail for Beginners(Includes Video)