Ultimate Guide to Autoplaying Videos in WordPress

by Blake Whittle | Apr 25, 2024 | Video

You add a video to a page, switch on autoplay, hit Update, and the page loads with a frozen black box. Or it plays fine on your laptop and does nothing on your phone. It looks like a bug. It's almost always a browser rule.

Then there's the opposite headache. Autoplay works, and now every visitor downloads your video whether they watch it or not. If your host meters bandwidth, you're paying for plays that never happened.

This guide fixes both. You get the quick answer first, then the reasons autoplay fails, then the full setup for the WordPress Video block, YouTube, Vimeo and Infinite Uploads.

How to Autoplay a Video in WordPress (the Short Answer)

Autoplay works when the video is muted. That's the whole trick. Chrome, Firefox and Safari let muted video start on its own and block most video that has sound. Pick the method that matches where your video lives.

  1. WordPress Video block. Select the block, open Settings in the sidebar, and turn on Autoplay. WordPress switches Muted and Play inline on for you. Turn on Loop if you want it to repeat.
  2. YouTube. Add autoplay=1 to the embed URL, like https://www.youtube.com/embed/VIDEO_ID?autoplay=1. Add mute=1 too so Chrome lets it start. YouTube's parameter reference documents autoplay but doesn't list mute, so test it on your own page. The documented route is player.mute() in the IFrame Player API.
  3. Vimeo. Add autoplay=1&muted=1 to the iframe URL. Both parameters are in Vimeo's player parameter list.
  4. Infinite Uploads. Turn on Autoplay and Muted in the Infinite Uploads Video block settings. Or tick both boxes in the video's Embed Code tab and copy the shortcode.

Why muted? Browsers treat autoplay with sound as a nuisance, because nobody asked for it. Chrome says muted autoplay is always allowed, and MDN's autoplay guide describes the same rule for browsers in general. Think of a silent video playing in a shop window. Nobody minds. A speaker blasting out of every browser tab? That gets blocked.

Why Your WordPress Video Won't Autoplay

Start at the top of this list and work down.

  1. The video isn't muted. This is the big one. Turn on the Muted toggle (or muted=1 for an embed) and reload. Chrome only allows autoplay with sound after a visitor has clicked on your site, or, on desktop, once they've played video with sound there before. You can't count on either for a new visitor.
  2. The iframe isn't allowed to autoplay. A video inside an iframe from another domain needs allow="autoplay" in the iframe tag, as Chrome's autoplay policy explains. YouTube's embed code already includes it. If you hand-wrote the iframe, add it. The Infinite Uploads embed includes it for you.
  3. iPhone wants it inline. On iPhone, a video without the playsinline attribute goes fullscreen to play, which WebKit documents for Safari. The WordPress Video block turns Play inline on automatically when Autoplay is on. A custom HTML video tag needs it added by hand.
  4. The video isn't on screen. WebKit says an autoplay video only starts once it's visible. If yours sits inside a closed tab or accordion, it won't start until that panel opens, so check where you've placed it.

Still stuck after all four? Test in a private window with no extensions. If it autoplays there, your normal browser has a stricter autoplay setting, and your visitors may too. You can't change that for them. A muted video is the only reliable path.

Infinite Uploads setup screen

Infinite Uploads

Offload, organize, and deliver your WordPress media from one plugin: cloud storage, video streaming, image optimization, and a global CDN, with no per-site limits.

See Pricing

Understanding Autoplay for WordPress Videos

The Basics of Video Autoplay

Autoplay means a video starts without the visitor pressing play. In HTML it's a single attribute on the video tag. For embeds from YouTube or Vimeo, it's a parameter on the URL. Either way, the browser has the final say. It decides whether the video starts, based on rules about sound, screen position and whether the visitor has interacted with your site. That's why the same page can autoplay on one device and sit silent on another.

Autoplay Pros and Cons

Pros

  • Motion catches the eye, so product demos and hero sections get noticed without a click.
  • Short muted loops work well as backgrounds, since there's nothing to hear or pause.
  • Visitors see the point of the page right away, which helps when your message is easier to show than to write.

Cons

  • Every autoplay video loads for every visitor, including the ones who scroll past it. That costs your visitors data and costs you bandwidth.
  • Browsers restrict it, so it won't behave the same everywhere.
  • It can annoy people, especially anyone in a quiet room, on a slow connection or on a metered phone plan.

The bandwidth con is the one that surprises people. A page with an autoplaying video can be fine on launch day and expensive once traffic picks up. I'll cover how to handle that further down.

Choosing the Right Video Type for Autoplay

Illustration of a monitor showing three video windows labeled YouTube, Vimeo and Self-Hosted

Where your video lives decides how autoplay behaves, what it costs and how much control you get. Here's how the four main options compare.

WordPress Video Hosting Plugins

A video hosting plugin like Infinite Uploads Video Cloud keeps the video off your web host entirely. You upload from the WordPress dashboard, the video is encoded for streaming, and it's delivered from a global CDN, so autoplay traffic never touches your server. You also get a player with no YouTube branding and no ads, plus per-video settings for Autoplay, Loop, Muted and Preload.

Animated demo of uploading a video with the Infinite Uploads Video block in the WordPress editor

The Video Library Editor is where you set those options per video. Tick Autoplay and Muted, and the shortcode updates to match.

Infinite Uploads Edit Video screen with the Embed Code tab showing the Autoplay, Loop and Muted checkboxes above the video shortcode
The Video Library Editor in Infinite Uploads, with Autoplay, Loop and Muted options in the Embed Code tab

YouTube Videos

YouTube is free and easy to embed, and YouTube's servers carry the traffic instead of yours. The tradeoffs are the YouTube branding, suggested videos and an autoplay setup that needs the right parameters. YouTube also says that with autoplay on, playback data collection and sharing happen on page load, not when the visitor presses play. Worth knowing if you run a privacy-conscious site.

Vimeo Videos

Vimeo has a cleaner player and fewer distractions. Autoplay, loop and muted are all documented player parameters, so the setup is a short URL change. The video still lives on Vimeo, so you're working inside its player and its rules.

Self-Hosted Videos

Self-hosting means uploading the file to your Media Library and playing it with the core Video block. You control everything, and autoplay is just a toggle. The cost lands on your web host. Every autoplay view pulls the full file from your server, so a few large videos on a busy page can slow the whole site down. That's fine for a small clip. It gets painful fast for anything longer.

How to Set Up Autoplay Videos in WordPress

Illustration of a person wearing headphones working at a desk with a video editing screen

Embedding YouTube Videos with Autoplay

  1. On YouTube, click Share under the video, then Embed, and copy the iframe code.
  2. In the WordPress editor, add a Custom HTML block and paste the code.
  3. In the iframe's src URL, add ?autoplay=1&mute=1 after the video ID. Leave the allow attribute as YouTube gave it to you, since it already includes autoplay.
  4. Update the page and test it in a private window.

One honest caveat. autoplay is documented in YouTube's parameter reference, and mute isn't. It's widely used and works for many people, but YouTube could change it. If you need it to be dependable, load the video with the IFrame Player API and call player.mute() before it plays.

Embedding Vimeo Videos with Autoplay

  1. On Vimeo, open the video, click Share, and copy the embed code.
  2. Paste it into a Custom HTML block.
  3. Add autoplay=1&muted=1 to the iframe URL. If the URL already has a ?, join the new parameters on with &.
  4. Update the page and test it.

Setting Up Self-Hosted Videos with Autoplay

  1. Add a Video block and choose your file from the Media Library.
  2. With the block selected, open the Settings tab in the sidebar.
  3. Turn on Autoplay. WordPress turns on Muted and Play inline automatically, and locks Muted while Autoplay is on.
  4. Turn on Loop if you want a repeating clip, and set Preload to Metadata so the browser doesn't fetch the whole file up front.
WordPress Video block settings panel with the Autoplay toggle on and the Muted toggle switched on automatically
Turn on Autoplay in the Video block and WordPress turns on Muted for you.

Prefer plain HTML? Put this in a Custom HTML block instead. Swap in your own file URL.

<video src="https://example.com/your-video.mp4" autoplay muted loop playsinline></video>

That covers the three common setups. If the video still won't start, go back to the checklist near the top of this page.

Advanced Embedding Features

Illustration of a laptop on a desk showing a web page with an embedded video

Looping Autoplay Videos

For a background clip or a short product demo, you'll want it to repeat. In the Video block, that's the Loop toggle. For a YouTube embed, add loop=1 and playlist=VIDEO_ID, using the same video ID in both places. YouTube's reference says single-video loops need the playlist parameter in IFrame embeds. For Vimeo, add loop=1.

Muting Autoplay Videos

Muting is what makes autoplay work in the first place. The Video block handles it for you. In a Vimeo embed, use muted=1. For YouTube, use mute=1 (see the caveat above) or player.mute(). Visitors can still unmute with the player controls, so keep those visible.

Hiding Video Player Controls

For a background video, you can remove the player controls. In a YouTube embed, add controls=0. Do it only for decorative video with no sound. If a video carries information, hiding the controls leaves people with no way to pause it or turn the sound on, which is an accessibility problem.

Optimizing Autoplay Videos for User Experience

Implementing Autoplay Without Annoying Users

Keep autoplay video muted, short and relevant. Leave the controls on so visitors can turn the sound on or stop it. Skip autoplay on pages where people come to read, and don't stack more than one autoplaying video on a screen. If a video doesn't earn its place on the page, a plain play button is the kinder choice.

Balancing Load Times with Video Autoplay

An autoplay video starts downloading the moment the page loads, so it competes with your images and scripts for the same connection. A few habits help:

  • Compress the file and use a short clip. A 10 second loop beats a 2 minute film.
  • Set Preload to Metadata so the browser doesn't pull the full file before it needs it.
  • Lazy load videos that sit below the first screen, so they only load when a visitor scrolls near them. Above the fold, a heavy video can slow down how fast your page looks ready.
  • Serve video from a CDN rather than your web host. Our guide to HLS video streaming for WordPress explains how adaptive streaming keeps playback smooth on slow connections.

How to use Infinite Uploads to Embed Videos in WordPress

If autoplay is going to bring traffic to your video, it helps to have the video served from somewhere built for it. Infinite Uploads Video Cloud handles encoding, storage and streaming from your WordPress dashboard, so large files don't hit your host's limits and autoplay plays don't eat your server's bandwidth. Setup takes a minute:

  1. Add the Infinite Uploads Video block to your page.
  2. Upload a video, or pick one from your cloud video library.
  3. In the block settings, turn on Autoplay and Muted together, since browsers only autoplay muted video.
  4. Turn on Loop if you want it to repeat, and leave Preload on unless you need to hold back the download.
Infinite Uploads video block autoplay settings
The Autoplay settings in the Infinite Uploads Video block

The player is customizable and has no YouTube branding or ads. Videos stream with HLS and are delivered from a CDN with 119+ points of presence, so a visitor in Sydney and a visitor in Chicago both get a quick start. Prefer shortcodes? Open the video in the Video Library Editor, tick Autoplay and Muted in the Embed Code tab, and copy the shortcode it gives you. See the full WordPress video hosting feature page for what's included.

Autoplay Without the Bandwidth Bill

Getting autoplay to work is the easy part. The part that bites later is the bill, or the slow page, when a hundred visitors turn into ten thousand. Autoplay is the one video setting that costs you on every page view, whether anyone watches or not.

Moving the video to Infinite Uploads Video Cloud takes that load off your host. Plans start at $8.25/mo billed yearly ($99/yr) for 25 GB of storage and 50 GB of CDN bandwidth, and you can start with a 7-day free trial. Check the plans on our pricing page to see which one fits your traffic.

Author

Written by

Blake Whittle

Blake Whittle is the owner of ClikIT, the company behind Infinite Uploads and Big File Uploads, a plugin running on more than 150,000 WordPress sites. He has been designing and developing WordPress sites since 2014 and specializes in media offloading, cloud storage, CDN delivery and image optimization. He also runs Backline, a white-label agency managing 300+ WordPress sites for partner agencies. Blake is based in Bloomington, Illinois.

Recent Post

Get WordPress media tips in your inbox

Guides, product updates and the occasional deal from the Infinite Uploads team. Unsubscribe anytime.


Infinite Uploads Black Friday: 50% off your first year with code BFCM50OFF

Create Your Account And Start Exploring

Try the Infinite Uploads plugin and discover all its benefits. By registering, you'll gain access to technical support, receive updates, and enjoy exclusive content. Don't wait any longer and join us today!