black friday 2026 label for the hellobar

Get ready for Black Friday! See offers →

WordPress6 min. read

How to embed a YouTube video in WordPress

Last updated: Oct 25, 2026
Illustration of a website with an embedded YouTube video player and an embed code panel.

You embed a YouTube video in WordPress by pasting its URL into a YouTube Embed block. Copy the URL from YouTube, add the block to your post or page, paste the URL and click Embed. The video stays on YouTube, and your visitors watch it on your page. If you want to set where the video starts or whether it plays automatically, paste YouTube's embed code instead.

Why embed a YouTube video instead of uploading it?

Embedding keeps the large video file off your own hosting. You link to the video rather than upload it, so WordPress shows the YouTube player on your page while the file itself stays on YouTube. There's nothing big to store, and your server doesn't have to send the video to every visitor.

It's worth adding a video wherever a topic is easier to show than to describe, such as a product demo or a short how-to. Visitors can watch it without leaving your site. You don't need a YouTube account of your own to embed a video, either. The trade-off is that the player is YouTube's, so it can show YouTube's branding and, at the end, suggestions for other videos.

How to embed a YouTube video with the YouTube Embed block

These steps are for the block editor, which WordPress has used since version 5.0. Open the post or page where the video should go. If you haven't set up your WordPress website yet, our guide shows how to install WordPress in one click.

  1. Find your video on YouTube and copy its URL from the browser's address bar.
  2. In your post or page, add a YouTube Embed block, for example by typing /youtube in a new paragraph block.
  3. Paste the YouTube URL into the block and click Embed.
  4. The video now shows in the editor. Click Preview to see how it looks on your page.

In the block's settings, the toggle that resizes the video for smaller devices is on by default. It keeps the video's aspect ratio when the browser window changes size, so the player still fits on a phone screen.

Embed a YouTube video with a shortcode

If you use the classic editor, or want to set the player's size yourself, wrap the video's URL in the embed shortcode. A shortcode is a short tag in square brackets that WordPress replaces with content on the page, in this case the YouTube player. The width and height are in pixels:

[embed width="640" height="360"]The YouTube URL[/embed]

Change the numbers to the size you want. In the block editor, the shortcode goes into a Shortcode block, which you add by typing /shortcode and pressing Enter.

How to get the YouTube embed code

The embed code is a short piece of HTML that YouTube gives you for each video and playlist that can be embedded. It's the route to take when you want to change how the player behaves, for example where the video starts. The code gives the player a fixed width and height, so check the page on your phone after you publish.

  1. On a computer, open the YouTube video or playlist you want to embed.
  2. Click Share, then choose Embed from the share options.
  3. Copy the HTML code from the box that appears.
  4. Paste the code into your website's HTML.

How to paste the embed code into WordPress

In the block editor, the embed code goes into a Custom HTML block.

  1. In a new paragraph block, type /html and press Enter to add a Custom HTML block.
  2. Click Edit HTML to open the code editor.
  3. Paste the embed code and check the preview next to it.
  4. Click Update when you're done.

If the video doesn't show after you save, check your user role. YouTube's embed code is an iframe, and WordPress strips iframes from the code of users who aren't allowed to add their own HTML, such as Contributors. If that's your role, ask the site's administrator to add the code, or use the YouTube Embed block, which only needs the video's URL.

Set where the video starts and how it plays

You can change how the player behaves by adding settings to the address in the embed code. They go right after the video ID, the letters and numbers that follow embed/. Put ? before the first setting and & before each one after it, as in embed/VIDEO-ID?start=30&autoplay=1. If the address already has a ? after the video ID, start with & instead.

  • Start time: start= followed by the number of seconds, such as start=30.
  • Autoplay: autoplay=1 plays the video as soon as the page loads. YouTube doesn't count autoplayed views.
  • Captions: cc_load_policy=1 shows captions by default.
  • Player controls: controls=0 hides the player controls.
  • Privacy-enhanced mode: change https://www.youtube.com in the code to https://www.youtube-nocookie.com. A view in this mode isn't used to personalise the viewer's YouTube experience. If your site asks visitors for cookie consent, check that your cookie banner still covers embedded videos.

How to embed a YouTube playlist, channel or live stream

A playlist works like a single video: paste the playlist's URL into the YouTube Embed block. The first video shows in the player, and the rest of the list is in the top right corner of the embed. Live streams work the same way, with a URL in the form youtube.com/live/ followed by the video ID.

To embed a YouTube channel in WordPress as a feed or a gallery, install and activate a WordPress plugin such as Feeds for YouTube or YotuWP.

Which YouTube videos can't you embed?

Private videos and videos with embedding switched off won't play on your page, even when you follow the steps. Age-restricted videos won't play on most sites other than YouTube.

  • YouTube lets you embed public and unlisted videos and playlists, but not private ones.
  • The person who uploads a video decides whether others may embed it.
  • Age-restricted videos can't be watched on most other websites. A visitor who plays one is sent to YouTube to watch it.

To embed a private YouTube video in WordPress, make it unlisted first. If the video is your own, you can do this in YouTube Studio. Anyone with the link can then watch it, but YouTube keeps it out of search results, unless someone puts it on a public playlist.

Do you need a plugin to embed YouTube videos?

No. WordPress has embedded YouTube videos on its own since version 2.9, so the steps above are all you need for a video or a playlist. It's worth adding a plugin when you want something the block doesn't do, such as a channel feed, a gallery or a lighter page.

A page with several embedded videos loads the full YouTube player for each one. A lazy-loading plugin loads the player only when a visitor clicks, so the page downloads less.

PluginWhat it addsGood for
Feeds for YouTube (Smash Balloon)Channel feeds in a list, gallery or grid layoutShowing your latest videos automatically
WP YouTube LyteLazy loading for embedded YouTube videosPages with several videos
YotuWPA responsive gallery of videos from a playlist or a channelA video gallery on one page
1 / 1

For more plugins, see our guide to recommended WordPress plugins.

Once your video is in place, publish the page and your visitors can watch it straight away. Because the video files stay on YouTube, your Hosting for WordPress plan only has to store and serve the page around them.

Every Hosting for WordPress plan includes a free SSL certificate, so visitors reach your pages over a secure connection.

Compare Hosting for WordPress plans

Recommended reading

  • WooCommerce beginner dashboard showing products, orders, payments, store analytics, and an online shop with product cards and add-to-cart buttons.
    WordPressAug 6, 2026

    What is WooCommerce?

    Do you want to start your online shop? Get to know WooCommerce in this guide: an e-commerce solution to build your shop.
  • Illustration of a slow WordPress site performance dashboard with warnings for images, plugins, scripts, and hosting.
    WordPressAug 5, 2026

    Why is my WordPress site so slow?

    Slow WordPress site? We look at the most common reasons and share how to speed up your WordPress website in this practical guide.
  • wordpress
    WordPressOct 30, 2025

    WordPress SEO – Checklist with 9 tips

    Increase traffic to your site with WordPress search engine optimisation. Follow our WordPress SEO guide and read about the best SEO plugins.