Youtube Tips & Strategies

How to Embed a YouTube Shorts Iframe

By Spencer Lanoue
October 31, 2025

Embedding a YouTube Short on your website should be simple, but the standard embed code creates a messy, horizontal player that ruins the vertical video experience. You’re not doing anything wrong, YouTube’s default sharing options just haven't caught up with their own content format. This guide will show you the right way to create a clean, vertical, and professional-looking YouTube Shorts iframe for your site.

Why You Should Embed YouTube Shorts on Your Website

Before jumping into the how-to, let's quickly cover why this is a smart move for your brand. In a world fixated on short-form video, leveraging your content on every possible surface is just good marketing. Embedding your Shorts accomplishes a few specific goals:

  • Boosts On-Page Engagement: Video is fantastic at keeping people on your website longer. A longer visit time (or "dwell time") can signal to search engines that your page offers high value, which can positively impact your SEO rankings.
  • Seamlessly Promotes Your YouTube Channel: You bring your best YouTube content directly to your website visitors, giving them a taste of what your channel offers. It’s an organic way to encourage new subscribers without making them leave your site.
  • Enhances Content and Written Text: A well-placed Short can illustrate a point, provide a quick tutorial, or simply break up a long wall of text in a blog post, making your content more dynamic and easier to digest.
  • Maintains Your Brand Aesthetic: Posting a broken, horizontal player for a vertical video just looks unprofessional. Getting the embed right ensures your website maintains a high-quality feel and provides a better user experience.

The Problem: Standard Embeds Ruin Your Vertical Videos

So, what’s going wrong? When you click the "Share" button on a standard, long-form YouTube video, you get an iframe embed option that looks like this:

<,iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" title="YouTube video player" frameborder="0" allow="accelerometer, autoplay, clipboard-write, encrypted-media, gyroscope, picture-in-picture, web-share" allowfullscreen>,<,/iframe>,

The problem is that YouTube Shorts don't give you this handy pre-made code. And if you try to build one yourself using a typical Shorts URL, it fails. A YouTube Shorts URL is structured differently:

https://www.youtube.com/shorts/YourVideoID

If you take `YourVideoID` and put it into the standard embed code, you'll end up with a wide, 16:9 player trying to display a 9:16 video. This results in huge black bars on the sides and a tiny video squished in the middle. It looks broken, feels clumsy to interact with, and defeats the entire purpose of creating vertical content in the first place.

To fix this, you need to manually construct the iframe with the right URL and correct dimensions. It’s easier than it sounds.

How to Correctly Embed a YouTube Shorts Iframe: A Step-by-Step Guide

Creating a perfect Shorts embed only takes two simple steps: adjusting the video URL and setting the iframe to a vertical aspect ratio. Let's walk through it.

Step 1: Find Your YouTube Shorts Video ID

The Video ID is the unique string of letters and numbers that identifies a specific YouTube video. You can find it at the end of the Shorts URL.

For example, in this URL:

https://www.youtube.com/shorts/aBCd3Fgh12i

The Video ID is aBCd3Fgh12i.

Go to your YouTube Short, copy that ID from the address bar, and keep it handy. This is the only piece of information you need from the original link.

Step 2: Construct the Correct Iframe Embed URL

This is where the magic happens. A Shorts `/shorts/` URL won't work inside an iframe. You need to convert it into the standard `/embed/` URL format that all YouTube embeds rely on.

The correct structure is:

https://www.youtube.com/embed/YourVideoID

Simply take the Video ID you found in the previous step and place it at the end of that URL. That’s it. You now have a working URL that will properly serve your video - you just need to put it inside an iframe.

The Complete Copy-and-Paste Iframe Code for YouTube Shorts

Now that you have the correct URL, you can build your full iframe code. The most important part is setting the `width` and `height` attributes to match a vertical 9:16 aspect ratio. A standard embed uses a 16:9 ratio (like 560x315), so you have to flip that logic.

Here is a battle-tested, copy-and-paste code snippet. Just replace `YourVideoID` with your own.

<,iframe
width="315"
height="560"
src="https://www.youtube.com/embed/YourVideoID"
title="YouTube video player"
frameborder="0"
allow="accelerometer, autoplay, clipboard-write, encrypted-media, gyroscope, picture-in-picture, web-share"
allowfullscreen>,
<,/iframe>,

Notice the dimensions: `width="315"` and `height="560"`. This creates a perfect vertical rectangle for your Short to play in. Other good vertical dimensions you could use include:

  • 360 x 640
  • 405 x 720
  • 270 x 480

As long as you maintain that vertical ratio, the player will look clean and professional.

Customizing Your YouTube Shorts Embed for Better Engagement

You can go a step further by adding parameters to the embed URL to control how your video behaves. These simple additions can help you create a more tailored experience for your visitors.

To add a parameter, add a question mark (`?`) after the Video ID, followed by the parameter. To add multiple parameters, separate them with an ampersand (`&`).

How to Make Your Short Loop Automatically

Short-form video often performs better on a loop. To make your embedded Short loop, you need to add two parameters: `loop=1` and `playlist=YourVideoID`. Yes, it’s a bit weird, but you need to tell the player that the video is its own playlist for the loop to engage properly.

Your URL will look like this:

src="https://www.youtube.com/embed/YourVideoID?loop=1&playlist=YourVideoID"

How to Autoplay Your Embedded Short

To make the video play automatically when someone visits the page, add `autoplay=1`. You should also add `mute=1`, as most modern browsers block autoplaying videos with sound.

Your URL will look like this:

src="https://www.youtube.com/embed/YourVideoID?autoplay=1&mute=1"

A word of caution: While autoplay can increase views, it can also annoy visitors and slow down page load times. Use it sparingly and only when it genuinely adds to the user experience.

How to Hide the Player Controls

If you want a super clean, minimalist look, you can hide the play/pause bar and other controls with the `controls=0` parameter. This is great for background videos or Shorts that loop seamlessly.

Your URL will look like this:

src="https://www.youtube.com/embed/YourVideoID?controls=0"

Putting It All Together: A Looping, Autoplaying, Control-Free Embed

<,iframe
width="315"
height="560"
src="https://www.youtube.com/embed/YourVideoID?
autoplay=1&mute=1&loop=1&playlist=YourVideoID&controls=0"
title="YouTube video player"
frameborder="0"
allow="accelerometer, autoplay, clipboard-write, encrypted-media, gyroscope, picture-in-picture, web-share"
allowfullscreen>,
<,/iframe>,

Best Practices for Using Embedded Shorts on Your Site

Now that you know how to embed your Shorts properly, here are a few final tips on doing it strategically.

  • Make it Responsive: Hard-coding the width and height can cause issues on different screen sizes. For best results, wrap your iframe in a responsive container div. The CSS for this is simple and ensures your video adapts to mobile, tablet, and desktop screens beautifully.
  • Provide Context: Don't just drop a video on the page and hope for the best. Introduce it with a sentence or two explaining what the viewer will see. After the video, add a call to action, like "For more tips like this, subscribe to our YouTube channel!"
  • Watch Your Page Speed: Each embedded video adds to your page’s load time. If you’re embedding multiple videos, consider enabling lazy loading for your iframes. Most modern website builders offer this feature, or you can add `loading="lazy"` to the iframe tag.
  • Put It Where It Matters: Embed Shorts where they add the most value. Use them in blog posts to demonstrate a step in a tutorial, on a product page to show off a feature in action, or on your "About" page to add a personal touch.

Final Thoughts

Getting your YouTube Shorts to display correctly on your website is all about using the `/embed/` URL format and setting a vertical aspect ratio for your iframe. By following the steps above, you can create a clean, professional viewing experience that enhances your content and funnels traffic back to your YouTube channel.

Embedding videos is a great tactic, but a truly effective social media strategy hinges on streamlined planning and scheduling. We built Postbase because the world of social media now lives on short-form video - Reels, TikToks, and of course, Shorts. We designed it from the ground up to make managing your entire video content calendar across all platforms feel incredibly simple, from seeing your schedule in one clean calendar to publishing videos without a hitch.

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Add an Etsy Link to Pinterest

Learn how to add your Etsy link to Pinterest and drive traffic to your shop. Discover strategies to create converting pins and turn browsers into customers.

Read more

How to Grant Access to Facebook Business Manager

Grant access to your Facebook Business Manager securely. Follow our step-by-step guide to add users and assign permissions without sharing your password.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Add Translation in an Instagram Post

Add translations to Instagram posts and connect globally. Learn manual techniques and discover Instagram's automatic translation features in this guide.

Read more

How to Optimize Facebook for Business

Optimize your Facebook Business Page for growth and sales with strategic tweaks. Learn to engage your community, create captivating content, and refine strategies.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating