Skip to content

How to Add Video to WooCommerce Product Gallery in 2026

How to Add Video to WooCommerce Product Gallery in 2026

You can add video to WooCommerce product gallery slides in three ways. WooCommerce 11.1 ships a beta feature for uploaded videos, a free plugin adds a YouTube link, and a short code snippet adds a YouTube slide.

We tested all three on a WooCommerce 11.2 test store running WordPress 7.1.3 in October 2026. We used one classic theme, Twenty Twenty-One, and one block theme, Twenty Twenty-Five. That shows where each method breaks.

Below you get a comparison, exact steps with screenshots for each method, and the code we ran. You also get page weight numbers for an MP4 file and a YouTube embed, plus a checklist for videos that do not show up.

Use the built-in feature when your video is an MP4 file you can upload. Use the free plugin or the code snippet when the video lives on YouTube. In our tests the built-in feature and the snippet worked on both themes, while the free plugin broke the block theme layout.

MethodVideo sourceBlock themeClassic themeCost
Built-in featureUploaded MP4WorkedWorkedFree
Free pluginYouTube linkDoubled the galleryWorkedFree with a paid upgrade
Code snippetYouTube linkWorkedWorkedFree
Three ways to add video to WooCommerce product gallery compared

The 11.1 release notes say the initial release supports “locally uploaded videos only”, which is why YouTube needs a plugin or code. Products that buyers want to see in use suit video well. Our guide on building buyer confidence in eCommerce covers six education strategies.

A gallery video helps buyers, but it rarely ranks on its own. Our video SEO guide covers how to get videos found in Google and YouTube.

WooCommerce 11.1 added an experimental Product gallery videos setting, and it is off by default. Turn it on under WooCommerce > Settings > Advanced > Features and then upload an MP4 in the Product gallery box. As of October 2026 the release notes label it beta.

Gallery video is one part of customizing the WooCommerce product page, which our template guide covers.

You need WooCommerce 11.1 or newer, and an MP4 file you are allowed to publish. Follow these steps on a product you can safely edit first:

  1. Open the Features screen: Go to WooCommerce > Settings > Advanced > Features. Tick Enable videos in product galleries under Experimental features and save.
    Product gallery videos setting under WooCommerce Features
  2. Open the product: Edit the product and find the Product gallery box in the right column. The link under the thumbnails now reads Add media to product gallery.
  3. Upload the video: Click that link, drop your MP4 on the Upload files tab, and click Add to gallery.
    Add media to product gallery window with an MP4 selected
  4. Set the order: Drag the video thumbnail to the spot you want. In our test the box showed a play icon on the video thumbnail.
    Product gallery box with a video thumbnail
  5. Update and check the page: Click Update and open the product page. The video thumbnail now sits in the strip under the main image.
    Product page with a video thumbnail in the gallery

Here is what we saw on the page. The video starts on its own, loops and plays without sound. It has no player controls. Shoppers cannot pause it or turn sound on.

Clicking the video opens the full-screen gallery on that slide, and it keeps playing muted there too. With no poster image set, the thumbnail showed a frame of the video with a play icon on top.

Note: When we dragged the video to the first place in the box, it landed in second place on the page. The product’s featured image stayed first. A video cannot replace it with this feature.

Our test used a 4-second clip, and the WooCommerce product gallery video played the same way on both themes. That makes this the method to try first for a short product demo. For a longer video, or one that needs sound and controls, use one of the next two methods.

Method 2: Use a Free WooCommerce Product Video Plugin for YouTube

A free WooCommerce product video plugin is the fastest way to show a YouTube video in the gallery. Product Video Gallery for WooCommerce adds a Product Video Url box to every product. According to its WordPress.org page, the free version supports YouTube only, with one video per product.

The same page lists Vimeo, Media Library files, HTML5 video and several videos per product as paid features. We tested version 1.5.2.3 of the free plugin, and we turned the built-in feature off first so the two would not overlap.

  1. Install the plugin: Go to Plugins > Add Plugin and search for Product Video Gallery for WooCommerce. Install and activate it.
  2. Paste the YouTube link: Edit a product and scroll to the Product Video Url box. Keep YouTube selected and paste the full video link.
    Product Video Url box with a YouTube link
  3. Update and check the page: Click Update and open the product page. The YouTube video appeared as the last thumbnail, and clicking it loaded the player.
    Gallery with a YouTube video thumbnail from the free plugin

That result is a WooCommerce product video gallery with one YouTube slide, and it came from Twenty Twenty-One, a classic theme. On Twenty Twenty-Five, a block theme, the plugin printed its own gallery above the product layout. WooCommerce’s normal gallery stayed in its usual column. The page showed two galleries.

Video shows a product in motion, and our AR plugin lets shoppers place 3D products in their room from the same product page.

Two galleries on a Twenty Twenty-Five product page

Tip: Test any gallery plugin on a staging copy of your own theme before you install it on the live store. A plugin that works on one theme can break the layout on another, as this one did.

Method 3: Add a YouTube Video With a Code Snippet

A code snippet lets you add video to WooCommerce product gallery pages on both classic and block themes. It hooks into the woocommerce_product_thumbnails action and prints the video as one more gallery slide. We tested the 45 lines below on WooCommerce 11.2 with Twenty Twenty-One and Twenty Twenty-Five.

Add the code to a child theme’s functions.php file or to a code snippets plugin. Do not edit a parent theme directly, because an update would erase the change:

<?php
/**
 * Show a YouTube video as a slide in the WooCommerce product gallery.
 * Reads two product custom fields: gallery_video_url and gallery_video_poster (a Media Library image ID).
 */
add_action(
	'woocommerce_product_thumbnails',
	function () {
		global $product, $wp_embed;

		if ( ! $product instanceof WC_Product ) {
			return;
		}

		$url = esc_url_raw( (string) $product->get_meta( 'gallery_video_url' ) );
		if ( ! $url ) {
			return;
		}

		// shortcode() caches the oEmbed result in post meta, so YouTube is not called on every page view.
		$html = $wp_embed->shortcode( array(), $url );
		if ( false === strpos( $html, '<iframe' ) ) {
			return;
		}

		$poster_id = absint( $product->get_meta( 'gallery_video_poster' ) );
		$thumb     = wp_get_attachment_image_url( $poster_id ? $poster_id : $product->get_image_id(), 'woocommerce_gallery_thumbnail' );

		printf(
			'<div class="woocommerce-product-gallery__image dd-gallery-video" data-thumb="%s">%s</div>',
			esc_url( $thumb ),
			$html // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- oEmbed output is filtered by core.
		);
	},
	15
);

add_action(
	'wp_enqueue_scripts',
	function () {
		wp_register_style( 'dd-gallery-video', false, array(), '1.0' );
		wp_enqueue_style( 'dd-gallery-video' );
		wp_add_inline_style( 'dd-gallery-video', '.dd-gallery-video iframe{display:block;width:100%;height:auto;max-height:none!important;aspect-ratio:16/9;border:0}.dd-gallery-video figure{margin:0}' );
	}
);

Each part of the snippet has a job. These are the choices that matter:

  • Hook and priority: The action fires inside the gallery wrapper, and priority 15 puts the video right after the main image. In our test it came out as the second slide.
  • Caching: The WordPress developer reference says the shortcode method stores embed HTML in post meta under keys starting with _oembed_. We saw those keys appear after the first page view.
  • Thumbnail: The slide needs a data-thumb attribute, or the thumbnail strip has no picture for it. The snippet uses your poster image and falls back to the featured image.
  • Height fix: On Twenty Twenty-One a theme script capped the iframe at 71 pixels tall. The max-height line in the CSS overrides that cap.
  • Escaping: The URL, poster ID and thumbnail pass through esc_url_raw, absint and esc_url. The embed HTML comes from WordPress’s own oEmbed filter.

The snippet reads two custom fields on each product. The next steps set them up:

  1. Show the Custom Fields box: Edit any product, open Screen Options at the top right, and tick Custom Fields.
    Screen Options with the Custom Fields box
  2. Add the video fields: Add a field named gallery_video_url with your YouTube link. Add a second field named gallery_video_poster with the ID of a Media Library image, which shows as post= in that image’s edit address.
    Custom Fields box with the video URL and poster fields
  3. Update and check the page: Click Update and open the product page. Click the second thumbnail, and the YouTube player fills the gallery.
    YouTube video playing in the WooCommerce product gallery

Two custom fields per product work for a handful of products. They do not scale to a catalog of hundreds, and they give store staff no friendly screen. If you want a proper video field in the product editor, our WooCommerce development services can build it into your theme.

Note: We tested YouTube only. Try any other video site on a staging copy first.

A video can be the WooCommerce featured video with the built-in feature, but only when the product has no featured image. In our test the video then became the first slide and the large main item. It played on a loop without sound.

We reached that state in the product editor with these steps:

  1. Remove the featured image: Click Remove product image in the Product image box.
  2. Put the video first: Drag the video to the first place in the Product gallery box.
  3. Update and check the page: Click Update and open the product page. The first thumbnail now carries the play icon.
    Product page with the video as the first gallery item

There is a catch for store owners. The shop page showed WooCommerce’s placeholder image for that product, because the shop grid does not use gallery videos.

Tip: Keep a featured image on every product that you list in your shop. Put the video in second place, which is where it landed in our first test.

Which Video File and Host Should You Use?

Use a short MP4 with the H.264 codec for the built-in feature, and a YouTube link when the video is long. A small MP4 adds little weight to the page. A YouTube embed loads its whole player when the page loads, even before anyone clicks.

In our own test we loaded the same product page three ways on Twenty Twenty-Five, three cold loads each. The page weighed 1,082 KB with no video. The 4-second MP4 added 132 KB, and the YouTube embed added about 4.2 MB.

Page weight with no video, an MP4 and a YouTube embed

That is a big difference for shoppers on mobile data. If you want a lighter page, the built-in MP4 route is the better trade for a short clip. Our post on the product detail page in eCommerce covers what else a product page needs.

To make a web-ready MP4 from a longer file, use FFmpeg. These settings turned our 4-second clip into a 125 KB H.264 file:

ffmpeg -i input.mov -c:v libx264 -pix_fmt yuv420p -movflags +faststart -crf 23 product-video.mp4

Give the poster or thumbnail image a clear name and alt text too. Our guides on naming images for SEO and adding alt tags to images in WordPress show how.

Most missing gallery videos have one of three causes, and each one is quick to check. The setting is off, the theme overrides a gallery template, or a gallery plugin replaced the default gallery. Our tests reproduced all three. Check them in that order.

  • Feature switched off: Open the Product gallery box. If the link reads Add product gallery images, the Product gallery videos setting is off. Turn it on under WooCommerce > Settings > Advanced > Features. When we switched the setting off, a saved video disappeared from the page.
  • Template override: We put an older product-thumbnails.php file in the Twenty Twenty-One theme folder and the video vanished from the gallery. WooCommerce lets a theme override templates by copying them into a woocommerce folder in the theme. Look for that folder.
  • Gallery plugin conflict: A plugin that builds its own gallery can double or replace the default one, as we saw on Twenty Twenty-Five. Deactivate it and test again.

Worth checking: Clear your site and CDN cache after you change a product, because a cached page can hide a video that is already saved.

Conclusion

To add video to WooCommerce product gallery pages, start with the built-in Product gallery videos feature when you have an MP4. It needs no plugin, and it worked on both themes we tested.

Choose the code snippet when the video is on YouTube. Treat the free plugin as an option for classic themes, where it worked in our test. Whichever you pick, watch the page weight and test on a copy of your store first.

Our WooCommerce development services are there if you want help building a video field.

Frequently Asked Questions (FAQs)

Yes. WooCommerce 11.1 added an experimental Product gallery videos setting that accepts uploaded videos, and you can also add a short code snippet for YouTube. We tested both on WooCommerce 11.2 with a classic theme and a block theme.

The built-in feature cannot, because its initial release supports locally uploaded videos only. A free plugin or the code snippet in this guide can add a YouTube link instead.

Only when the product has no featured image. With one set, the video landed in second place in our test. After we removed the featured image, the video became the first slide.

No. In our test it autoplayed muted, looped, and showed no player controls, both in the gallery and in the full-screen view. Use YouTube through the plugin or the snippet if shoppers need sound and controls.

Q5. Does a product video slow down the page?

It can. On our test page a 4-second MP4 added 132 KB, while a YouTube embed added about 4.2 MB on the first load. Keep self-hosted clips short and small.

Check three things. The setting must be on, your theme must have no old gallery template override, and no gallery plugin should replace the default gallery. Then clear your cache and reload the product page.

Yash Kapoor
Yash Kapoor

Yash Kapoor is the founder and WordPress expert at DevDiggers, where he builds WordPress and WooCommerce plugins for loyalty programs, point-of-sale systems, digital wallets and affiliate management. He writes about developer tools, site performance and the technical side of running a WordPress store. He draws on years of building and maintaining production plugin codebases.

Leave a Reply

Your email address will not be published. Required fields are marked *