The short answer: paste the video’s address on its own line in the block editor, or add a Video block and pick a file from the media library, and WordPress turns it into a player. That covers a public YouTube or Vimeo video or an MP4 on your own site. When the video should only play for members, or you want a viewer’s name on screen and watch statistics, a player such as MediaShield wraps the same video with those rules.
This guide teaches the core WordPress methods first, with the fixes for the problems people hit most often, and then covers the point where a plain embed stops being enough.
Key points
- A pasted YouTube or Vimeo address becomes an embed with no plugin. WordPress does this through a feature called oEmbed.
- An MP4 you upload to the media library plays in the Video block. A very large file is better kept on a video host.
- Embeds fail for a small set of reasons: the address is not on its own line, the editor strips an iframe, the video is private, or a cookie or security plugin blocks the frame.
- A core embed has no access control. Anyone who can open the page can play the video.
- For members-only lessons, a viewer watermark, resume and watch data, add a player on top of the host you already use.
How do I embed a video in WordPress?
You have four methods. They differ in who hosts the file and how much control you get.
| Method | Where the video lives | Best for |
|---|---|---|
| Paste a URL | YouTube, Vimeo and other supported sites | The quickest way to show a public video |
| Embed block | The same sites, with a block to set options | Placing a video inside a layout |
| Video block | Your own media library | Short clips you own |
| Custom HTML block | Any host that gives you embed code | Hosts WordPress does not recognise |
Pick the host first. If you already keep your videos on YouTube or Vimeo, use a pasted address. If you have a short MP4, upload it. If your host gives you a code snippet to paste, use the Custom HTML block.
How do I embed a YouTube video in WordPress?
This is the case most people mean, and it is the easiest.
- Open the video on YouTube and copy the address from the browser bar, or use the Share button and copy the link.
- Open the post or page in the block editor.
- Click an empty paragraph and paste the address. WordPress converts it to a YouTube embed block and shows a preview.
If you would rather add the block yourself, click the plus button, search for “YouTube” and paste the address into the field. The Embed block exists for many sites, and YouTube is the one most sites use.
In the block’s toolbar and sidebar you can change alignment and turn on Resize for smaller devices, which keeps the player at the right proportions on a phone. The address can be a standard watch link, a short youtu.be link or a link that includes a start time.
Two details that save trouble:
- The address must be the video’s own address, not a channel, a search page or a playlist overview page you meant to show as a single video.
- The video must allow embedding. On YouTube, a creator can switch embedding off for a video. If it is off, the embed shows an error where the player should be.
How do I embed a Vimeo video in WordPress?
The steps match YouTube. Copy the address of the video page, for example https://vimeo.com/ followed by the number, and paste it on an empty line. WordPress shows the Vimeo block.
Vimeo adds one wrinkle. A video can be set so that it plays only on domains you name. If the embed shows a message that the video is private or cannot be embedded on this site, open the video’s settings on Vimeo and check the privacy and embed options, and add your domain if the video is limited to specific sites.
How do I embed an MP4 or a local video in WordPress?
Use the Video block when the file is yours and small.
- Add a Video block.
- Click Upload to send a file from your computer, or Media Library to pick one you already uploaded.
- Use the sidebar to set Autoplay, Loop, Muted, Playback controls and Play inline, and to choose a poster image that shows before the video starts.
Use MP4 with H.264 video and AAC audio. Every modern browser plays it. WebM and Ogg also work in many browsers, but MP4 is the safe choice.
You will meet three limits quickly:
- Upload size. Your host sets a maximum upload size, often between 2 MB and 64 MB on shared plans. A video larger than the limit fails to upload. You can raise the limit through your host or in your PHP settings, but the next two limits remain.
- Bandwidth. Every viewer downloads the file from your own server. A popular video on a small hosting plan slows the whole site.
- No adaptive streaming. YouTube and Vimeo lower the quality when a viewer’s connection is slow. A plain MP4 does not. Viewers on a weak connection wait for buffering.
For anything longer than a short clip, keep the file on a video host and embed from there.
There is also a core shortcode, [video src="https://example.com/clip.mp4"], which does the same job in the Classic editor or a Shortcode block.
How do I embed Wistia, Bunny Stream or another host?
WordPress recognises a fixed list of sites for URL pasting. For any host outside that list, the host gives you an embed code, usually an iframe or a script. Add a Custom HTML block and paste the code there.
Some points to know:
- Your user account needs permission to add raw HTML. On single-site WordPress, administrators and editors have it. On multisite, only super admins do by default. Without it, WordPress removes the iframe when you save and the block shows empty.
- The Custom HTML block shows a preview tab, so check the embed there before you publish.
- Keep the code exactly as the host provided it. Editing the width and height attributes is fine. Changing the address is not.
MediaShield plays videos from YouTube, Vimeo, Wistia, Bunny Stream and your own server from one block, which avoids pasting a different kind of code for each host.
How do I make an embedded video responsive?
A responsive video keeps its shape and fills its column at every screen width. With core embeds this is mostly automatic:
- Embed blocks. Keep Resize for smaller devices on in the block sidebar. WordPress then keeps the aspect ratio and scales the player down on a phone.
- Video block. The video scales to fit its container by default. Avoid fixed pixel widths in custom CSS.
- Custom HTML iframes. An iframe with a fixed width of 800 pixels overflows a phone screen. Wrap it in a container that keeps a 16:9 ratio and sets the iframe to fill it, or set
width: 100%andaspect-ratio: 16 / 9on the iframe in your theme’s CSS.
If a video looks squashed or has black bars, check the host. The black bars come from the video file itself when it was recorded at a different ratio, such as vertical video shown in a landscape frame.
Why is my embedded video not working?
Most failures fall into a short list. Work down it in order.
- The address is not on its own line. Auto-embedding works when the address sits alone in its own paragraph. If it is in the middle of a sentence, WordPress leaves it as a link. Move it to its own line.
- The address is plain text. In the Classic editor, the address must not be a clickable link. If you see it underlined in blue, remove the link and paste again.
- The video is private or removed. A private video cannot be embedded anywhere. A deleted video leaves a “video unavailable” frame.
- Embedding is disabled on the host. The owner of a YouTube or Vimeo video can restrict where it plays. Open the video’s settings on the host.
- The iframe was stripped. When you paste embed code and save, WordPress may remove the iframe if your role lacks the unfiltered HTML permission. Ask an administrator, or have the video added by a user who has it.
- Mixed content. A site on https that loads an address starting with http is blocked by the browser. Use the https address.
- A cookie or privacy plugin blocks the frame. Consent plugins often hold back third-party embeds until the visitor accepts cookies. The frame shows a message or stays empty. Test in a private window after accepting.
- A security header blocks it. If your site or a security plugin sends headers that stop other sites from framing content, that covers your own embedded players in some setups. Check browser developer tools for a message about refusing to connect.
- A caching or minify plugin changed the script. Clear the cache and, if that fixes it, exclude the embed script from minification.
- A theme or plugin conflict. Switch to a default theme for a minute and deactivate plugins one at a time to find the cause.
If the video plays in the editor preview but not on the live page, the cause is nearly always caching, a consent plugin or a security header.
What a plain embed cannot do
A core embed is designed to show a public video to everyone. It has no idea who the visitor is. That is the right behaviour for a promo video on a landing page. It is a poor fit for paid lessons, for several reasons.
- Anyone with the page address can watch. Even if you hide the page from your menu, the video plays for whoever finds the page.
- Unlisted still means public to anyone with the link. The YouTube address sits in the page source. See unlisted YouTube videos for courses.
- No viewer identity. Nothing on screen says who is watching, so a leaked recording points nowhere.
- No device limit. One login can play videos on any number of devices at once.
- No watch data. You cannot see who watched, how far they got or where they stopped.
- No resume. A student who closes the tab starts again from the beginning unless the host’s player remembers them.
When a player like MediaShield is the better choice
Use a core embed for public videos. Use a player when any of these apply:
- The video is for members or students only.
- You want the viewer’s name on the video while it plays.
- You want to limit how many devices one account can watch on at once.
- You want to resume where a viewer left off, and to see watch history and completion.
- You want a lesson to be marked complete when a student finishes the video, using LearnDash, Tutor LMS or LifterLMS.
MediaShield keeps the video on the host you already use. You add it to the MediaShield library, then place it with a block or a shortcode. The steps:
- Go to MediaShield > Videos > Add New Video.
- Paste the YouTube, Vimeo, Wistia or Bunny address, or upload a file. Detected Platform names the host it recognised. See add your first video.
- Set Protection Level to Standard for a login check, a viewer watermark, session tracking and milestones.
- Insert the MediaShield Video block, or paste
[mediashield id=42]with your video’s own number. - Open the page logged out in a private window. You should see a login prompt. Log in and the video plays with your name on it.
The free plugin includes the login check, role restriction, the viewer watermark, resume, device limits and watch tracking. Pro adds connecting host accounts to browse and import, course-plugin completion, suspicious-viewing flags, exports and more. See free vs pro and pricing.
What a player does not do
Be clear about the limits before you rely on it:
- The host’s address is still in the page for platform videos. A YouTube, Vimeo, Wistia or Bunny embed has to carry its own video ID so it can play. A determined viewer can find it. Hiding the file address works only for videos on your own server.
- The watermark is an overlay. It is drawn over the player in the browser and is not part of the video file. It makes a screen recording traceable. It does not prevent one.
- Only library videos are protected. A video you never added to MediaShield plays as it did before.
- Self-hosted files depend on the server. The rule that blocks direct access to uploaded files is for Apache. On nginx, you add the rule that Site Health gives you.
- It does not encrypt video or add captions. The host handles encoding and quality.
For the full picture of what protection can and cannot do, read how to protect course videos in WordPress.
Common questions
How do I embed a video in WordPress without a plugin?
Paste the video’s address on its own line in the block editor, and WordPress converts it to a player for YouTube, Vimeo and other supported sites. For your own MP4, add a Video block and upload the file. No plugin is needed for either.
How do I embed a video from YouTube in WordPress?
Copy the video’s address from YouTube, then paste it into an empty paragraph in the block editor. WordPress shows a YouTube block with a preview. Turn on Resize for smaller devices in the block settings so the player fits phone screens.
Why does my video not show up after I paste the link?
The usual causes are that the address sits inside a sentence instead of on its own line, the video is private, embedding is switched off on the host, or a consent plugin is holding the frame back until cookies are accepted. Check those four first.
Should I upload videos to the WordPress media library?
Only for short clips. Large files exceed upload limits, use your server’s bandwidth and do not adjust quality for slow connections. A video host handles all three, so keep longer videos there and embed them.
Can I make an embedded video members-only?
Core WordPress cannot do that on its own. Restricting the page hides the page, and the video address can still be found. A player that checks the viewer before it plays, such as MediaShield, adds the login and role check to the video itself. See who can watch.
Does MediaShield work with videos already embedded on my pages?
Yes, for videos that are in the MediaShield library. MediaShield scans a page’s content for YouTube, Vimeo, Bunny, Wistia and file embeds and wraps the ones it recognises from the library. An embed that is not in the library is left alone, so add the video first.
Is MediaShield free?
The free plugin covers login and role gating, the viewer watermark, resume, device limits and watch tracking. Pro adds extras such as course-plugin lesson completion and host account connections. See pricing for current plans.