How to Add a YouTube Video to WordPress Website

Videos can double the time users spend on your website – here’s how to bring YouTube into WordPress without coding.
Add YouTube Videos

Many of our users look for a simple way to add YouTube videos to their WordPress websites – whether it’s tutorials, product demos, or event highlights. Embedding videos directly on a website makes content easier to watch and keeps visitors engaged without sending them away to another platform. That extra time spent on site often turns into more clicks, sign-ups, or interactions.

A YouTube Video Widget makes embedding effortless. No technical setup, no compatibility headaches – just a clean, reliable way to display your content. Business owners say it saves them hours while giving their websites a more polished feel.

In this guide, you’ll learn:

  • Step-by-step setup. Detailed instructions for adding YouTube videos to WordPress
  • Alternative methods explained. Comparison of native methods and third-party widget.
  • Expert best practices. Key tips for video placement, responsiveness, and performance.
  • Troubleshooting tips. How to resolve common issues with embedded videos.

We’ve broken the setup into two parts: a quick-start guide for instant results, and a full walkthrough for deeper customization. Let’s begin with the basics.

How to Add a YouTube Video to WordPress Website: Simple Steps

This quick guide shows you how to add a YouTube video to your WordPress website quickly.

  1. Open the Elfsight’s editor and pick a template.
  2. Customize your YouTube video widget.
  3. Click “Add to website for free” and copy the code.
  4. Paste it into your WordPress website’s backend.

Get your YouTube video live right in our free editor!

Why Elfsight’s YouTube Widget Stands Out

Discover the primary features that make this widget special and help you organize, design, and monetize your YouTube content – right on your WordPress website.

Key Feature Why it Matters
Show any YouTube content, grouped and labeled You decide if visitors see a playlist, channel, or single videos, and everything stays tidy and easy to browse.
Three preview layouts and flexible playback modes Visitors choose how they watch: pop-up, inline, or straight on YouTube, with up to 12 elements that switch on or off for a custom experience.
Style your widget with five presets or custom colors Make each part of your gallery match your brand, from headers to popups, without effort.
Adjustable gallery layout and navigation controls Set the number of columns, rows, and navigation options so your gallery always fits your website and your visitors can find videos fast.
Connect your AdSense account to monetize traffic Earn revenue from embedded video views right on your website, turning your gallery into a new income stream.

You can explore every feature on the widget’s Features Page, where you’ll find the full description of its functions. Now that you know what it can do, let’s see how it works in practice in our detailed guide below.

Adding YouTube Videos to WordPress Step-by-Step

This walkthrough covers the whole flow: from choosing a template to publishing, so that you know exactly where to click when you decide to create your own widget:

1. Choose a Template

The first thing you’ll see in the widget editor is the choice of three main layout styles: grid, list, and slider. Grid shows videos in rows, List stacks them vertically with more room for descriptions, and Slider displays them in a swipeable carousel.

💡 Tip: Use Grid for a dedicated “Videos” section, List for tutorials or story-driven content, and Slider when you want motion without taking up space.

Once you’ve selected a layout you like – click “Continue with this template“.

Choose a template for YouTube embed

2. Add the Source

This step decides which videos appear in your gallery. Click “Source” in the left panel, enter a URL to a YouTube video, playlist or your entire channel, depending on the goal. To organize videos into categories (for example: Tutorials vs. Testimonials) – use Source Groups. This adds navigation tabs to your widget.

Add channel source

3. Customize the layout

Once the videos are in, it’s time to decide how they’ll appear. You can show or hide the channel information, video details, decide if videos should open inline, in a popup lightbox, or on YouTube itself, pick navigation styles for slider (arrows, drag/swipe, dots, or scroll), and more.

Adjust the layout of the widget

4. Set the design

Now it’s about making the widget match your website’s look. Under the “Appearance” tab, choose a preset Color Scheme to start, then adjust colors of individual elements: header, buttons, tabs, backgrounds, etc.

💡 Tip: To match your exact WordPress colors, choose the Custom theme → color picker → enter the desired color in RGBA format.

For full control, paste CSS code directly. For example, you could make thumbnails larger or align text differently. Feel free to explore our Forum for ready-made CSS from other users.

Customize the appearance of the plugin

5. Finalize your widget

Before you publish, a few optional but powerful settings are worth checking. By default, the widget uses Elfsight’s key to fetch videos, but for many videos or heavy traffic you can add your own YouTube Data API key from Google Cloud Console.

💡 Tip: If you’re in the YouTube Partner Program and want to show ads, you can connect your AdSense account. Create ad units in AdSense, then slot them into the gallery via the widget.

At this stage, you can also enable privacy-enhanced mode, set the widget language to match your audience and double check the layout on mobile.

Fix the settings of the YouTube gallery

6. Add the widget to WordPress

Choose the method below that matches whether you want the widget on a single page or site-wide.

Install on a specific page

Method 1: Install via Themes
  1. In WordPress admin go to Appearance → Themes, find the theme to edit and click (…)
  2. Open the page/template where you want to show the widget and click Add Block.
  3. Select Custom HTML, paste your Elfsight snippet into the popup and click Save or Update.
Method 2: Install via Pages
  1. In WordPress admin go to Pages and open the page you want to edit.
  2. Click Add Block in the editor and choose Custom HTML.
  3. Paste your Elfsight code Save.

Install on all pages (site-wide)

Method 3: Install via Theme Editor
  1. In WordPress admin go to Appearance → Theme Editor.
  2. Open this file or equivalent: footer.php Insert your Elfsight embed code before the closing tag. Click Update File.
Method 4: Install via Widgets
  1. In WordPress admin go to Appearance → Widgets.
  2. Open Custom HTML from Available Widgets, choose a Footer widget area and click Add Widget.
  3. Paste Elfsight code into the Content field and click Save.
Method 5: Install via Customize
  1. In WordPress admin go to Appearance → Customize.
  2. Choose Widgets, click Add a Widget and select Custom HTML.
  3. Paste the snippet, click Done, then Publish to apply changes.
Pro Check: After installing, refresh and test on desktop and mobile. If the widget doesn’t appear, ensure you pasted the full embed code into a Custom HTML/Widget/Theme file (not a text field).

If you want to explore different ways to display YouTube content or need a plugin-based approach, continue to the next section on alternative methods.

Adding YouTube Videos Without Elfsight

You can add YouTube videos to a WordPress website using several built-in methods, but each comes with its own limitations compared to Elfsight.

Pasting the YouTube Link Directly

You can embed a YouTube video by simply pasting its URL into the WordPress editor.

  1. Find the video URL. Copy the link from the YouTube address bar or use YouTube’s Share button.
  2. Open your editor. Go to the WordPress post or page where you want the video.
  3. Paste the URL. Place the link on a new line in the editor.
  4. Verify the embed. WordPress automatically displays the video player.
  5. Publish or update. Save your changes to make the video live.
📌 Note: Limited customization
You can’t style the player or adjust layout beyond basic alignment—no gallery options or advanced display settings.

If you want to learn more about embedding a YouTube video by simply pasting its link, check out the official WordPress.com Support Guide.

Using the YouTube Block in Gutenberg

WordPress’s block editor includes a dedicated YouTube block to embed videos.

  1. Open the block editor. Edit the post or page you want to update.
  2. Add a block. Click the plus icon and search for “YouTube.”
  3. Insert the block. Select the YouTube block to add it.
  4. Paste the video URL. Enter the link and click “Embed.”
  5. Adjust basic settings. Use the Block Toolbar for minor tweaks.
📌 Note: Single video focus
This method only displays one video at a time and does not support playlists or galleries natively.

For a step-by-step walkthrough about the YouTube block in Gutenberg, check out the this official support article.

Embedding with the Video Widget

You can place videos in sidebars or footers using the WordPress Video widget.

  1. Access Widgets. Go to Appearance then Widgets in the dashboard.
  2. Find the Video widget. Drag it to the desired location.
  3. Add your video. Click “Add Video” and choose a file or paste a YouTube embed code.
  4. Configure display. Adjust simple settings like position.
  5. Save changes. Make sure to save your widget layout.
📌 Note: No gallery or playlist support
You can only display one video per widget and layout options are minimal.

Which YouTube Embedding Method Works Best for WordPress?

Method Major Pro 👍 Major Con 👎
Elfsight Advanced gallery layouts and customization. Requires a separate account and may need occasional updates.
Paste URL Fast and easy with no setup needed. Only basic embedding, no gallery or playlist features.
YouTube Block Simple and works with Gutenberg editor. Limited to single videos, lacks advanced customization.
Video Widget Lets you show videos in sidebars or footers. No support for galleries or playlists, and very basic styling.

Here are some practical tips for making your YouTube Gallery widget look great and work smoothly on any WordPress website.

With Elfsight team, we’ve helped hundreds of users embed YouTube galleries and optimize them for real results. Here’s our hands-on checklist to make your YouTube Gallery stand out and work seamlessly from day one.

  1. Select the right source. Looking for an updating feed? A channel works best. Showcasing a product line? Go for the playlist. Featuring one standout video? A single link keeps it simple.
  2. Group videos by topic, product, or theme. Split videos into groups like “Tutorials,” “Customer Stories,” or “Behind the Scenes”, so your visitors instantly know where to click.
  3. Test all three preview layouts to determine which best fits your design. For example, the list layout works well when text matters, like tutorials. The slider feels lighter on crowded pages.
  4. Customize gallery styles with branded colors. Even a small tweak – matching the gallery’s header and button colors to your store’s palette – stops the widget from looking bolted on.
  5. Adjust for both desktop and mobile to guarantee an optimal viewing experience across devices. Drop columns to 1–2 for small screens and make sure tap targets aren’t too tiny.
  6. Enable search and navigation controls to allow visitors to quickly filter and jump to the content they want, especially in larger galleries – they’ll stick around longer.
  7. Integrate your AdSense account to start monetizing video traffic. Be mindful with ads: one or two well-placed units are enough to complement your content without feeling too spammy.
  8. Preview like a visitor. Check the gallery on multiple devices and browsers before publishing. Look out for cut-off titles, squished thumbnails, or clunky popups.

Let’s move from features to practice and see how the YouTube Gallery Widget works for real businesses. Here’s a success story shared by one of our users and community members.

YouTube Gallery at Work: Wales Outdoors

Wales Outdoors is a tourism business run by Andrew Lamb. His website promotes hiking and adventure tours across Wales. With 10+ Elfsight widgets in place, the YouTube Gallery has become one of the cornerstones, giving visitors a lively space to explore video highlights of real tours and experiences.

Before using Elfsight

Presenting multimedia content in a consistent and appealing way was a challenge. Video and social content felt scattered, which made it harder to show the unique character of the tours and to build trust with potential clients.

  • No central space for video content
  • Limited visual appeal and branding options
  • Difficulty using media to build trust and drive bookings

With the YouTube Gallery

“Elfsight has been a game changer with widgets that work, work well, and are visually attractive.”

Andrew Lamb, Wales Outdoors

On a dedicated YouTube page, the widget now gathers all of Andrew’s tour videos into a structured, easy-to-navigate gallery. Visitors can browse past adventures, watch highlights, and get an authentic feel for upcoming tours without leaving the website. The consistent styling ties the gallery into the rest of the brand design, creating a polished impression that supports both marketing and sales.

Wales Outdoors YouTube Gallery

Results

By embedding the YouTube Gallery, Andrew created a central hub for his video content that holds visitors’ attention longer and encourages them to explore more. The videos add credibility to his tours, supporting customer trust and helping convert interest into bookings.

Other widgets in use

Wales Outdoors also uses All-in-One Reviews, AI Chatbot, Photo Gallery, Store Locator, and more. Together, these widgets create a website that is informative, interactive, and ready to support customer decisions at every step.

🎯 Takeaway:
The YouTube Gallery gives tourism websites a simple way to turn authentic video content into a sales driver by combining trust, visual appeal, and easy navigation.

With these real-world examples, it’s clear that YouTube Gallery can transform how businesses present video content, no matter the industry. The following FAQ answers common questions to help you make the most of your own YouTube Widget setup.

YouTube Widget Issues & Fixes

Adding a YouTube video widget to a WordPress website feels straightforward, but real-world setup brings surprises. You might see videos not loading, layout issues, or strange error messages after pasting the code. Hands-on troubleshooting usually solves things quickly if you know what to check.

Why isn’t my widget displaying on my website after installation?

Double-check that the widget code is copied and inserted in the correct place, and confirm that the widget hasn’t been hidden, deleted, or exceeded its monthly view limit in your Elfsight dashboard. Also, confirm display conditions and schedules in widget settings.

How do I fix layout or responsiveness problems after embedding the widget?

Try refreshing your browser cache and checking your website on multiple devices. Adjust display settings in the widget editor and ensure no conflicting scripts or themes affect widget behavior. Consult Elfsight’s help guides for specific platform styling tips.

What should I do if the widget installation code gets commented out or removed?

If you see your widget code wrapped in HTML comments, remove the comment tags and paste the code into your website’s backend again. This commonly happens during content editing or migration.

Can browser extensions block Elfsight widgets from loading?

Yes, ad blockers, privacy tools, or script blockers may prevent widgets from appearing. Test your website in an incognito window and disable extensions if necessary or whitelist *.elfsight.com.

How to solve issues with Content Security Policy (CSP) blocking external scripts?

If you see errors mentioning Content Security Policy in your browser console, update your website’s CSP settings to allow scripts from *.elfsight.com and *.elfsightcdn.com.

If you still run into trouble after checking the basics above, below are the official Elfsight resources and links to deeper troubleshooting guides.

Looking for Deeper Insights?

We hope this guide gives you a solid starting point for working with widgets on your website. We love hearing real stories and creative use cases from our readers – share your feedback, suggestions, or experiences with us, and stay connected with the Elfsight team on X.

Article by
Content Manager
Hi, I’m Kristina – content manager at Elfsight. My articles cover practical insights and how-to guides on smart widgets that tackle real website challenges, helping you build a stronger online presence.