How to embed a video
Learn how to embed YouTube, Vimeo, and other videos into your WordPress pages and posts without slowing down your site.
- Time
- 2–5 minutes
- Difficulty
- Beginner
- You’ll need
- A page or post open for editing · A video URL from YouTube or Vimeo
Adding video to your pages makes them more engaging. The best approach is to host your video on YouTube or Vimeo and embed it into WordPress — this keeps your site fast because the video loads from a separate video platform, not from your own hosting. This guide shows you how.
Quick summary
Copy the video URL from YouTube or Vimeo. In your WordPress page or post, add a YouTube or Vimeo block (using the + button), paste the URL, and click Embed. The video embeds and is ready to play. Don't upload video files directly to WordPress — it's slow and uses up your hosting storage.
What you'll need
- A page or post open for editing. See how to edit a page if needed.
- A video already uploaded to YouTube or Vimeo, with its URL copied.
Don't upload video files directly to WordPress
WordPress can technically accept video file uploads, but this is a bad idea. Video files are very large and will fill up your hosting storage quickly, slow down your site, and may exceed your host's file size limits. Always host video on YouTube or Vimeo and embed the link.
Embed a YouTube video
Go to YouTube and find your video. Copy the full URL from your browser's address bar, or use YouTube's Share option and copy the link it gives you. WordPress accepts both the short youtu.be link and the full youtube.com address.
In the WordPress editor, click the + button where you want the video. Type youtube in the search field and click the YouTube block.
Paste the YouTube URL into the input field that appears and click Embed (or press Enter). The video loads in the editor as a preview.
Preview the page to confirm the video plays correctly before publishing.
Embed a Vimeo video
The process is identical to YouTube.
Go to Vimeo and open your video. Click Share, then Copy link. (Share is at the top right of the video's settings page, and under the player on its vimeo.com video page.) Or open the video page and copy the URL from your browser's address bar.
In WordPress, click + and add a Vimeo block. Type vimeo in the block picker search.
Paste the Vimeo URL and click Embed. The video embeds.
Use the generic Embed block for other platforms
WordPress supports embedding from many platforms beyond YouTube and Vimeo — including TikTok, Twitter, Spotify, and more. (Facebook and Instagram embeds no longer work without extra developer setup.) If you don't see a dedicated block for the platform you want:
Click + and search for "Embed" to add the generic Embed block.
Paste the URL of the content you want to embed and click Embed. WordPress will attempt to create the embed automatically.
Not every platform supports embedding in WordPress. If the embed doesn't work, you may need to use the platform's own embed code — see below.
Using an embed code (iframe) from another platform
Some services give you an "embed code" — a snippet of HTML you paste into your site. To add it:
Copy the embed code from the platform (look for a "Share" or "Embed" button).
In the WordPress editor, add a Custom HTML block. Click +, search for "Custom HTML," and add the block.
Paste the embed code into the Custom HTML block. The video or content will appear when you preview or publish the page.
Custom HTML needs care
Custom HTML blocks render exactly what you paste. If you paste the wrong code, it can break the layout of the page. Only some roles can add code like this: Administrators and Editors on a standard site, and only Super Admins on a multisite network. If you're unsure, or your role can't add it, ask your project lead.
Controlling the video layout
After embedding a video, you can change its alignment in the toolbar:
| Option | What it does |
|---|---|
| None | The default. The video sits in the normal content column |
| Align center | Centers the video in the content column |
| Wide width | Stretches the video wider than the content column (only if your theme supports it) |
| Full width | Makes the video span edge to edge (only if your theme supports it) |
You'll also see Align left and Align right. For most articles and blog posts, the default works best. For landing pages, wide or full-width can look more impactful.
What about video in the background of a section?
For a video playing as a background (like a silent hero banner), use a Cover block rather than the standard Video or YouTube block. The Cover block can use an uploaded video as its background, and since WordPress 7.0 it can also use an embedded video from a URL. Your theme or page builder may offer its own option too. Ask your project lead to set that up.
Common questions
My embedded video shows a broken block in the editor — what should I check?
First, make sure the URL is correct. On YouTube, only public and unlisted videos can be embedded; private videos can't. The video's owner must also allow embedding, and some owners limit the countries where a video can be shown. On Vimeo, the owner can restrict where a video may be embedded. Paste the URL into a browser tab to confirm the video loads there. Also check there are no extra spaces in the URL field.
The video doesn't show on my live site even though it looks fine in the editor
This can happen if the video's privacy or embed settings on YouTube or Vimeo were changed after you embedded it. Go to the video platform and check those settings. Also check on your live site — the editor preview sometimes differs.
Can I control whether the video auto-plays?
The YouTube and Vimeo blocks have no autoplay setting, so the video plays the way the platform's player normally does. Browsers generally block autoplay unless the video is muted. For more control over auto-play behavior, you need the video's embed code with custom parameters — ask your project lead.
Can I add captions to an embedded video?
Captions for YouTube and Vimeo videos are managed on those platforms, not in WordPress; the YouTube and Vimeo blocks have no caption-track setting. Log in to your YouTube or Vimeo account and add captions there. Viewers can then turn them on in the embedded player on your site (on Vimeo, with the player's CC button).
Should I add a video block or a Columns block with a video inside it?
Either works. If you want text beside the video, put a Columns block on the page and add the YouTube block inside one column. If the video should be full-width on its own, add it directly as a standalone YouTube or Vimeo block.
Related guides
- Working with blocks
- The most useful blocks, explained
- How to add images to a page or post
- Using video on your website
- How to edit a page
- My changes aren't showing up
Need a hand?
Learn more
Last updated
How to add images to a page or post
Step-by-step instructions for adding, positioning, and captioning images in WordPress pages and posts using the block editor.
The media library explained
Learn what the WordPress media library is, what it stores, and how to navigate it to find and manage your site's images and files.