Header Text - 3 Ways to Embed a Video in WordPress

Videos play a huge role in boosting user engagement, so learning to embed video in WordPress websites, is of paramount importance in today\s digital age. In addition, when someone watches a video, they usually stay on your site longer and search engines like Google often rank pages with videos higher than those with none, which means more people can find your site.

Embedding videos in WordPress is easy and doesn’t require uploading large video files on your site. Instead, you can embed videos from platforms like YouTube, Vimeo, or others.

This guide describes three ways to embed video in WordPress to offer visitors a better experience without slowing down your WordPress website.

KEY TAKEAWAYS

  1. Embedding videos in WordPress is simple and improves user engagement on your site.
  2. Use the oEmbed method to quickly add videos by pasting the video URL to your blog post or page.
  3. The iFrame method offers more control over video size and uses embed codes from platforms like YouTube.
  4. Embed video in WordPress sidebar using the Video widget or a Custom HTML widget with iFrame code for extra visibility.
  5. Avoid uploading videos directly to your hosting account to save server space and bandwidth.
  6. Use external platforms like YouTube or Vimeo to boost traffic, visibility, and sharing options for your videos.
  7. Optimize your videos by compressing them, enabling lazy loading, and adding captions for better accessibility and SEO.

Significance of Embedding Video in WordPress

Including videos on your website is a great way to enhance your digital marketing efforts. Compared to plain text or images, videos make better use of the same space by delivering more information quickly. A single video can explain a concept or tell a story that would take several paragraphs or multiple images to convey.

Videos are also easily shareable, making them ideal for expanding your reach. You can share existing videos relevant to your niche, create your own and distribute them across social media, or use them in targeted advertising campaigns. This helps you connect with a wider and potential audience while keeping your content engaging.

Moreover, videos can improve user engagement and positively impact your site’s SEO. They encourage visitors to stay on your pages longer, which signals to search engines that your content is valuable.

How to Embed a Video in WordPress

In this section, we show you 3 ways to embed video in WordPress:

  1. Use oEmbed
  2. Use iFrame
  3. Use Widget.

Use oEmbed

Embedding video in WordPress is super easy with the oEmbed protocol. It allows WordPress to automatically fetch and display videos from supported platforms, like YouTube, Vimeo, and more, without complicated coding.

With oEmbed, you copy and paste a video URL into your content, and WordPress does the rest for you. It’s simple, fast, and perfect for beginners, regardless of whether they use a block editor (a.k.a. Gutenberg Editor) or a classic editor. Here’s how to do it step-by-step:

Go to a video hosting platform like YouTube and open the video you want to share. Copy your video’s URL from the address bar at the top of your browser.

In the visual editor of your line and not linked to any text. WordPress page or post, paste the copied URL into the content area. Ensure the URL is on its specific

After pasting the URL, WordPress will automatically fetch the video and show it in your editor.

Embed A Video In WordPress - Use oEmbed to Add Video to WordPress

You can click Preview in new tab to see how it will look to visitors. Once you’re satisfied with the video’s placement and appearance, click Publish (for new posts) or Save (for existing posts) to make the changes live on your website.

Embed A Video In WordPress - Preview Embedded Video

Important: In WordPress 5.9+, you can switch to the visual editor by navigating to the three-dot menu in the top right and selecting Visual editor. Alternatively, you can use Ctrl + Shift + Alt + M to switch between the visual and code editors.

Use iFrame

Another way to embed video in WordPress is by using an iFrame. An iFrame (short for “inline frame”) is a small window on your website that displays content from another source, such as a video, directly into your website.

When you use an iFrame, the video is streamed from the original platform (like YouTube), so it doesn’t take up space on your website. This method is handy when you want more control over the video or if the oEmbed method isn’t available.

Here’s how you can use iFrame to embed video in WordPress:

Go to the video platform (e.g., YouTube) and open the video you want to embed. Look for Share, usually found below the video, and click it. Then, click Embed to generate the code.

Embed A Video In WordPress - Generate Embed Code

Copy the code provided.

Embed A Video In WordPress - Copy Embed Code

Now, log in to your WordPress site and go to the post or page where you want to embed the video. Click Edit to open the editor. For this tutorial example, we edit a post.

Embed A Video In WordPress - Edit Post

In the WordPress editor go to  ⋮  (at top-right)Code editor to switch to the HTML editor. This lets you add HTML directly to your content.

Embed A Video In WordPress - Switch to Code Editor

If you use a Classic Editor plugin, click Text to switch to an HTML editor.

Embed A Video In WordPress - Switch to Text Editor

Now, paste the iFrame code you copied earlier into the desired spot in the editor. You can also customize the code if required, such as adjusting the width or height of the video. After adding the iFrame code, click Exit code editor (classic editor plugin users will click on Visual) to return to a visual view in the editor and preview it to see how the video appears on your site.

Embed A Video In WordPress - Add iFrame Code

Here’s how it looks on the front end based on the iFrame we added; yours might look a little different depending on your iFrame code and your customizations:

Embed A Video In WordPress - Use iFrame to Add Video in WordPress

Use Widget

Adding videos to your WordPress sidebar is a great way to grab attention and make your site more interactive. The sidebar is visible on every page (depending on your WordPress theme), so placing a video there can encourage visitors to engage with your content, whether they’re reading a blog post or browsing your site.

Here’s how you can easily embed video in the WordPress website’s sidebar:

Log in to your WordPress Dashboard. Go to Appearance Widgets. Click Toggle block inserter.

Embed A Video In WordPress - Block Inserter Button

In the Blocks section, search for the Video widget. This is a built-in WordPress widget. Drag and drop the Video widget into the sidebar where you want the video to appear. We added it under Recent Posts.

Embed A Video In WordPress - Add Video Widget

After placing the widget, you’ll have three options to embed video in WordPress:

  1. Upload: If you have a video file on your computer, upload it directly. But be aware: this is not recommended because videos can use a lot of server resources. 
  2. Insert from URL: This is the better option. Paste the link to your video from platforms like YouTube, Vimeo, or any other supported service.
  3. Media Library: You can add videos from the WordPress Media Libary.

In this example, we use the second approach. Fill in the video’s URL and click Enter. Once the video is added, you can adjust its title and preview how it looks. Once done with that, click Update to ensure your changes are applied. Now, visit your site to check how the video looks in the sidebar. If necessary, go back to Widgets to make adjustments.

Embed A Video In WordPress - Add Video to Sidebar

With Hosted.com’s WordPress Hosting, you’ll enjoy lightning-fast performance and seamless integration for all your multimedia needs.
Our expert support team will take care of all the technical details, allowing you to concentrate on creating engaging content.

Use Widget with Classic Widgets Plugin

If you’re using a Classic Widgets plugin, the steps may differ. Here’s how to embed video in WordPress:

Go to Appearance Widgets. Click the Video widget. Choose the location where you wish to add the video and click Add Widget.

Embed A Video In WordPress - Add Video Widget

Give this widget a title, then click Add Video.

Embed A Video In WordPress - Add Video

Once again, there are 3 options to add a video: Upload Files, Media Library, and Insert from URL.

Embed A Video In WordPress - Options to Add Video

Click Insert from URL. Specify the video’s URL, and click Add to Widget.

Embed A Video In WordPress - Add Video to Widget

You can also click Edit Video to add subtitles or modify video details. Otherwise, click Save.

Embed A Video In WordPress - Edit or Save Video Widget

Here’s how it will now look on the user end:

Embed A Video In WordPress - Preview Video

Now that you’ve learned how to add video to WordPress, it’s important to know why you shouldn’t upload videos directly to your hosting account. Let’s discuss this below.

Platforms Supporting Auto-Embed in WordPress

WordPress allows auto-embeds for many platforms beyond YouTube. You can easily include Facebook posts and tweets in your WordPress site. Here’s a list of platforms that are compatible with WordPress’s auto-embed feature:

  1. YouTube
  2. Vimeo
  3. Scribd
  4. Dailymotion
  5. Flickr
  6. wordpress.tv
  7. Instagram
  8. Reddit
  9. SlideShare
  10. X
  11. SoundCloud
  12. Facebook
  13. Spotify
  14. WordPress plugin directory
  15. TED

Tips for Video Optimization

Videos can make your site more engaging, but can also impact the loading speed if you don’t optimize them properly. However, you can ensure videos load quickly, look great, and are accessible to everyone by following these simple tips. Let’s dive in!

Compress Videos to Improve Load Times: Large video files can take a long time to load, which may frustrate your visitors. Compressing videos reduces their file size without losing much quality. You can use tools like Adobe Media Encoder to compress your videos before uploading them to a hosting platform. Smaller files load faster, helping your website perform better and keeping visitors happy.

Use Lazy Loading to Delay Loading Videos Until Visible: Lazy loading is a smart trick that improves your site’s speed. Instead of loading all videos when the page opens, lazy loading only loads a video when a user scrolls down and it becomes visible. This reduces the initial load time of your page, making it faster for visitors to start browsing. Many WordPress plugins, like Lazy Load by WP Rocket, can enable lazy loading for your videos with just a few clicks.

Add Video Captions for Better Accessibility & SEO: Captions are a great way to make your videos more inclusive. They help people who are deaf or hard of hearing understand your content. Captions also improve SEO because search engines can read the text in the captions, making your video more likely to appear in search results. Most platforms, like YouTube, let you easily add captions or subtitles to your videos.

Choose a Reliable Hosting Platform for Video Files: A reliable platform like YouTube, Vimeo, Dailymotion, or Wistia can make a big difference in hosting videos. These platforms are designed for streaming, so they deliver videos quickly and in high quality. Hosting videos externally saves space on your website’s server, helping your site stay fast and efficient.

Now, you might be thinking about the reasons to avoid uploading videos to your web hosting platform. Let’s discuss this below.

Why not Upload Videos to Your Hosting?

While it might seem like a good idea to upload videos directly to your WordPress hosting account, this approach can create problems for your website. Instead, external video platforms like YouTube or Vimeo are a better solution. Let’s explore why.

Minimize Server Resource Usage

When you upload videos directly to your hosting account, they take up server space. Videos are large files, and if you host them, this can quickly fill your storage limit. This not only slows down your website but can also make it more expensive if you need to upgrade your hosting plan.

Also, when users watch videos hosted on your server, they use a lot of bandwidth. If many people watch your videos simultaneously, this can overload your server, causing your website to crash or load very slowly. A slow site is bad for user experience and can hurt your search engine rankings.

By embedding videos from external platforms, you save server space and bandwidth. These platforms handle the heavy lifting so your site stays fast and responsive.

Enhance Traffic, Visibility, & Shares

Using external platforms for video hosting doesn’t just save resources; it also helps more people find your content. Platforms like YouTube and Vimeo have millions of daily users. When you upload a video there, it can appear in search results or recommendations, bringing new visitors to your website.

External platforms also make sharing videos easier. Visitors can quickly share your videos on social media or other websites, increasing your content’s reach. Most platforms let you add links to your website in the video description, which drives traffic back to your site.

Also, these platforms automatically optimize your videos for different devices, ensuring they load quickly and look great on phones, tablets, and computers. This makes your web content more accessible to a wider audience.

So, by using external platforms, you save resources, keep your site fast, and make it easier for people to find and share your content. It’s a win-win for you and your visitors!

Strip Banner Text - Get expert support to customize your site with Hosted.com’s WordPress Hosting. [Get started]

FAQs

Can I upload videos directly to WordPress?

Yes, you can upload videos directly to WordPress, but this is not ideal. Videos can use a lot of storage and affect your website speed. A better choice is to embed videos from platforms like YouTube. These platforms handle streaming, which keeps your website fast and efficient.

What is the ideal video format for WordPress?

The best video format for WordPress is MP4 (H.264 encoding). MP4 files are widely supported by all browsers and devices, which makes them a reliable choice for smooth playback. Other formats like WebM or OGV can work but may not be supported on every platform.

Can I use plugins to embed video in WordPress?

Yes, you can. Videopack, Presto Player, and ARVE (Advanced Responsive Video Embedder) are some plugins that embed video in WordPress.

How can I make my embedded videos mobile-friendly?

Most video platforms like YouTube automatically optimize videos for mobile devices. However, to ensure mobile-friendliness, you can use responsive themes or plugins that adjust the video size to fit screens. Enable lazy loading to improve performance on mobile devices. Avoid hard-coding fixed dimensions for videos, and instead, use relative sizes (e.g., percentages) to allow flexibility.

What’s the difference between embedding & uploading videos?

Embedding means inserting a video from an external platform by pasting its link or iFrame code. Uploading involves storing the video file directly on your WordPress site. When you embed video in WordPress, the video is hosted on an external platform, saving server space. However, uploading means storing the video file directly on your WordPress site. This uses up hosting resources and can slow down your site, especially if the video is large or has high traffic.

Other Related Tutorials & Blogs:

How To Create A WordPress Child Theme

How To Embed Video In WordPress: 3 Methods And Tips

How to Add WordPress Custom CSS: 5 Easy Methods

How To Install WordPress On A Subdomain: 2 Easy Methods

How To Create A Custom WordPress Author Page

Login to Hosted.com Account

1. Go to the Hosted.com Login website page.

How To Login To Hosted.com - Login in to Hosted.com Account

2. Enter your Email and Password and click the “Sign In” button.