NEWMeet the new Video Gallery — YouTube, TikTok, Instagram Reels, Vimeo and Twitch in one widget.

Find a widget for you

You can use our widgets to accomplish practically any task on your website — increase users' confidence, grow conversion, engage your visitors, provide support, etc.

See All Widgets
Video Gallery

YouTube Shorts Embed Code Generator

Turn any YouTube Shorts link into a vertical 9:16 embed code. Copy it into your website and the Short plays right on your page.

  • Free
  • No sign-up
  • Works on any website
  • Updated September 2026

Settings

ShortLive player preview on the production page
Embed code
<div style="position:relative;width:100%;max-width:360px;aspect-ratio:9 / 16;">
  <iframe style="position:absolute;inset:0;width:100%;height:100%;border:0;" src="https://www.youtube.com/embed/abc123DEF45?loop=1&playlist=abc123DEF45&playsinline=1" title="YouTube Shorts player" allow="autoplay; encrypted-media; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

Elfsight Video Gallery

Show all your Shorts, not just one

Video Gallery pulls your YouTube Shorts into a vertical carousel that keeps itself up to date — no new code for every Short.

  • Auto-updates when you publish new videos
  • Carousel, grid, masonry or player with playlist
  • YouTube, Vimeo, TikTok, Instagram, Twitch and any video link
  • No coding — works on any website
Create Widget for Free Create a Shorts galleryNo credit card needed
YouTube
Behind the Scenes: Studio Tour
TikTok
First Descent of the Season: Heli Drop in the Alps
Twitch
Late Night Ranked Grind
Instagram
Morning Flow: 10-Minute Full Body Stretch
YouTube
Restaurant Plating at Home, Step by Step
Vimeo
Where the Pavement Ends: Full Off-Road Test

How to use the YouTube Shorts Embed Code generator

  1. 1Copy the Shorts link

    On YouTube, tap Share → Copy link on the Short you want to embed.

  2. 2Set the size

    Choose a max width. The player keeps the vertical 9:16 shape on every screen.

  3. 3Paste the code

    Copy the code and paste it into an HTML or embed block on your site.

How Shorts embeds work

SettingWhat it doesWhy it matters
/embed/VIDEO_IDShorts use the standard YouTube embed player.The /shorts/ URL itself can’t be embedded.
9:16 containerKeeps the video vertical and responsive.A plain iframe defaults to a wide 16:9 box.
max widthLimits how wide the vertical player gets.Stops the Short from filling the whole screen on desktop.
autoplay + muteStarts playback automatically without sound.Browsers block autoplay with sound.
loop + playlistReplays the Short like in the Shorts feed.Loop only works with the playlist parameter.

Source: YouTube embedded players and player parameters

How to add the code to your website

In the block editor, add a Custom HTML block where the video should appear and paste the code. In the classic editor, switch to the Text tab first.

See Video Gallery for WordPress →

Embed code vs. Elfsight Video Gallery

Embed codeVideo Gallery
Videos per embedOne video (or one playlist)Unlimited videos in one widget
Stays up to dateEdit the code for every new videoNew YouTube Shorts videos appear automatically
Mix sourcesOne platform per snippetYouTube, Vimeo, TikTok, Instagram, Twitch and any video link
LayoutsSingle playerPlayer with Gallery, Carousel, Grid, Masonry, Playlist
Responsive designNeeds a CSS wrapperBuilt in
CodingCopy and paste code for each videoNo code — edit visually in the editor
PriceFreeFree plan, no credit card needed

Frequently asked questions

Can you embed YouTube Shorts on a website?

Yes. Shorts play in the standard YouTube embed player — the generator converts the /shorts/ link into an embed code and wraps it in a vertical 9:16 container.

Why does my embedded Short look horizontal?

A plain YouTube iframe uses a 16:9 box. Use the code from this generator, which sets a 9:16 aspect ratio so the Short stays vertical.

How do I embed Shorts in WordPress?

Add a Custom HTML block and paste the code from the generator. It works the same in Elementor’s HTML widget.

Can I embed all Shorts from my channel?

Not with one iframe. A widget like Elfsight Video Gallery can show all your Shorts in a vertical carousel that updates automatically.

Is it free?

Yes, free with no sign-up.

Official documentation

More free tools

Related guides

From one video to a gallery people watch

Create a free video gallery in minutes and add it to any website.

Create Widget for Free