Source: https://divicake.com/blog/divi-5-video-autoplay-no-plugin/

[Blog](https://divicake.com/blog/)/[Tips & Tricks](https://divicake.com/category/tips-tricks/)

# Divi 5 Video Autoplay (No Plugin): How to Autoplay Videos in the Divi Video Module

By Divi Cake·26 February 2026·Updated 19 August 2026·6 min read

Divi 5 Video Autoplay (No Plugin): How to Autoplay Videos in the Divi Video Module

We may earn a commission from affiliate links in this post. [Disclosure policy](https://divicake.com/affiliate-disclosure-policy/)

On this page

- [What you need before starting](https://divicake.com#what-you-need-before-starting)
- [Step 1: Upload your MP4 video to the Media Library](https://divicake.com#step-1-upload-your-mp4-video-to-the-media-library)
- [Step 2: Open the page in Divi 5 Visual Builder](https://divicake.com#step-2-open-the-page-in-divi-5-visual-builder)
- [Step 3: Add the Divi Video Module](https://divicake.com#step-3-add-the-divi-video-module)
- [Step 4: Replace the default YouTube video with your MP4 file](https://divicake.com#step-4-replace-the-default-youtube-video-with-your-mp4-file)
- [Step 5: Add a custom class (Divi 5 way) using Attributes](https://divicake.com#step-5-add-a-custom-class-divi-5-way-using-attributes)
- [Step 6: Choose “class” and add your class name](https://divicake.com#step-6-choose-class-and-add-your-class-name)
- [Step 7: Confirm the class attribute value](https://divicake.com#step-7-confirm-the-class-attribute-value)
- [Step 8: Add a Code Module below the video](https://divicake.com#step-8-add-a-code-module-below-the-video)
- [Step 9: Copy this autoplay script inside](https://divicake.com#step-9-copy-this-autoplay-script-inside)
- [Step 10: Past this autoplay script inside the Code Module](https://divicake.com#step-10-past-this-autoplay-script-inside-the-code-module)
- [Step 11: Save and preview on the live page](https://divicake.com#step-11-save-and-preview-on-the-live-page)
- [Troubleshooting: If Divi 5 autoplay is not working](https://divicake.com#troubleshooting-if-divi-5-autoplay-is-not-working)

- [1) Autoplay works on desktop but not on mobile](https://divicake.com#1-autoplay-works-on-desktop-but-not-on-mobile)
- [2) Autoplay only works after refresh](https://divicake.com#2-autoplay-only-works-after-refresh)
- [3) Video still shows controls](https://divicake.com#3-video-still-shows-controls)
- [4) Autoplay with sound does not work](https://divicake.com#4-autoplay-with-sound-does-not-work)
- [Optional upgrade: Unmute on click (nice for UX)](https://divicake.com#optional-upgrade-unmute-on-click-nice-for-ux)
- [Why this method is better than plugins](https://divicake.com#why-this-method-is-better-than-plugins)
- [Conclusion](https://divicake.com#conclusion)
- [Quick FAQs](https://divicake.com#quick-faqs)

- [Does Divi 5 have autoplay in the Video Module?](https://divicake.com#does-divi-5-have-autoplay-in-the-video-module)
- [Will this work with YouTube or Vimeo videos?](https://divicake.com#will-this-work-with-youtube-or-vimeo-videos)
- [Why must autoplay be muted?](https://divicake.com#why-must-autoplay-be-muted)

If you’ve tried to enable video autoplay in [Divi 5](https://divicake.com/go/divi-5-0/), you already know the annoying part: the [Divi Video Module](https://divicake.com/go/divi-video-module/) still doesn’t give you a simple “Autoplay” switch for self-hosted videos.

And even if you find a workaround, browsers like Chrome, Safari, and Firefox love to block autoplay when it’s done the wrong way (especially with sound).

The good news is this: [Divi 5](https://divicake.com/blog/divi-5-guide-for-beginners/) autoplay works perfectly when you do it in the browser-friendly way.

In this tutorial, we are going to show you how to autoplay a self-hosted MP4 video in Divi 5 using the Video Module, without any plugin. This method is also great if you want:

- Divi autoplay video loop
- Divi video autoplay muted
- Divi video autoplay no controls
- A clean hero-style autoplay video
- A setup that is more likely to work on mobile (including iPhone, with playsinline)

## What you need before starting

This guide is for self-hosted videos (like MP4) uploaded to your WordPress Media Library.

If you’re using YouTube or Vimeo, autoplay rules are different and often restricted. So for this tutorial, we’re focusing on the Divi Video Module with a real MP4 file.

## Step 1: Upload your MP4 video to the Media Library

In your first screenshot, you’re doing it the right way:

- Go to [WordPress Dashboard](https://divicake.com/blog/wordpress-tutorial/)
- Click Media
- Choose Add Media File
- Select your MP4 video from your computer
- Click Open to upload

This is the best way to start because Divi 5 will pull the video directly from your Media Library.

Uploading an MP4 video to the WordPress Media Library for Divi 5 video autoplay

## Step 2: Open the page in Divi 5 Visual Builder

Next, go to the page where you want autoplay:

- Click Pages
- Open All Pages
- Click Edit With Divi on the page you want

Opening a WordPress page and clicking Edit With Divi to launch the Divi 5 builder

## Step 3: Add the Divi Video Module

Now inside the Divi 5 builder:

- Click Add Module and [Add Video Module](https://divicake.com/go/divi-video-module/)
- Click on the Content tab
- Search for Video
- Delete the WordPress Default Video

This step helps you target keywords like Divi video module autoplay and Divi 5 video module autoplay because we’re using the actual Divi Video module, not [background video](https://divicake.com/blog/divi-backgrounds-colors-images-videos/) tricks.

Adding the Divi 5 Video Module from the module picker in the Visual Builder

## Step 4: Replace the default YouTube video with your MP4 file

Divi usually shows a default YouTube URL in the video module. Remove that and add your MP4:

- Click Add Video
- Select your uploaded MP4 from the Media Library
- Click Upload a Video (or confirm selection)

This is how you make Divi autoplay video work using a self-hosted file.

Selecting a self-hosted MP4 file inside the Divi 5 Video Module settings

## Step 5: Add a custom class (Divi 5 way) using Attributes

This is the most important part and it’s also where Divi 5 is different from [older Divi versions](https://divicake.com/go/divi-4/).

Instead of the old “CSS ID & Classes” field, Divi 5 uses Attributes.

Here’s what you did:

- Click the module settings gear (top-right of the module) or double click on the Divi Module (Setting will open in Divi 5)
- Go to the [Advanced tab](https://divicake.com/blog/getting-started-with-divi-advanced-settings/)
- Expand Attributes
- Click Add Attribute

Opening the Divi 5 Video Module Advanced tab to access Attributes

## Step 6: Choose “class” and add your class name

Now set the attribute like this:

- Select the Class in Attributes

This is your targeting hook. It ensures the autoplay script runs only on videos you choose, not every video sitewide.

Adding a new class attribute in Divi 5 Attributes for the autoplay video module

## Step 7: Confirm the class attribute value

In your next screenshot, you already confirmed it correctly:

- Target Element: Module
- Attribute Name: class
- Copy this CSS Class “dc-autoplay” and Past in the Attribute Value

Perfect. Now we can attach autoplay behavior only to videos with this class.

Setting the Divi 5 video module class attribute to dc-autoplay for autoplay targeting

## Step 8: Add a Code Module below the video

Now we’re going to add the script using a [Divi Code Module](https://divicake.com/go/divi-code-module/).

- Click the Plus Icon where you want to insert the code
- Search for Code
- Add the Code module

This is the safest method because it keeps the script on the page where you need autoplay.

Adding a Divi 5 Code module to paste the autoplay JavaScript script

## Step 9: Copy this autoplay script inside

Copy this code and will past in the Code Module in next step:

<script> document.addEventListener("DOMContentLoaded", function () {  const videos = document.querySelectorAll(".dc-autoplay video");   videos.forEach((video) => {  video.muted = true;  video.loop = true;  video.playsInline = true;  video.setAttribute("playsinline", "");  video.removeAttribute("controls");   const tryPlay = () => video.play().catch(() => {});  video.addEventListener("loadedmetadata", tryPlay);  tryPlay();  }); }); </script>

What this script does:

- Finds only videos inside elements with class dc-autoplay
- Enables muted autoplay (browser friendly)
- Enables loop
- Forces inline playback (important for iPhone and mobile)
- Removes controls for a cleaner autoplay look
- Attempts playback safely without breaking the page

This is one of the most reliable approaches for:

- divi autoplay not working
- divi video autoplay on mobile
- divi video autoplay loop
- divi video autoplay no controls

## Step 10: Past this autoplay script inside the Code Module

The Code Module setting will automatically open if not open, then Double tap on it will open easily. Past the Copied code as shown in this step.

- Go to the [Content tab](https://divicake.com/blog/getting-started-with-divi-content-settings/)
- Click on the Text
- Past the Copied Code in the Code box as show in the below screenshot

Pasting the Divi 5 autoplay JavaScript script into the Code Module content area under Text in the Divi builder

## Step 11: Save and preview on the live page

Finally:

- Click Save
- Click on the Preview

Autoplay often does not behave perfectly inside builder previews, so always test on the real page.

Saving the Divi 5 page and clicking Preview to test the autoplay video on the live page

Learn More: [Divi 5 Review: Is It Still the Best WordPress Builder?](https://divicake.com/blog/divi-5-review-best-wordpress-page-builder/)

## Troubleshooting: If Divi 5 autoplay is not working

### 1) Autoplay works on desktop but not on mobile

This is usually normal. Mobile browsers (especially iOS Safari) are stricter. Make sure:

- video is muted
- playsinline is set (we did that)
- video is MP4 (recommended)
- file is not huge

### 2) Autoplay only works after refresh

Clear cache:

- caching plugin cache
- server cache
- browser cache

Then test in an incognito/private window.

### 3) Video still shows controls

We remove controls in the script. If you still see them:

- confirm the correct class is attached: dc-autoplay
- make sure the Code module is on the same page
- check if another script is overriding controls

### 4) Autoplay with sound does not work

That’s browser policy. Sound autoplay is blocked unless the user interacts first. The correct approach is autoplay muted, then allow click to unmute (optional upgrade below).

## Optional upgrade: Unmute on click (nice for UX)

If you want visitors to click the video to turn sound on, add this inside the forEach loop:

video.addEventListener(“click”, () => {

video.muted = !video.muted;

});

This gives you the best of both worlds:

- muted autoplay works
- users can unmute when they want

Divi 5 tutorial graphic showing optional unmute on click code for muted autoplay videos in the Divi Video Module

## Why this method is better than plugins

Plugins often:

- add extra scripts globally
- slow down pages
- break on updates
- conflict with caching/minification

This approach is lightweight, targeted, and clean because:

- it runs only where you add dc-autoplay
- it follows autoplay policy rules
- it is easy to reuse on any page

## Conclusion

Autoplay in Divi 5 isn’t really a [Divi](https://divicake.com/go/divi/) limitation as much as it’s a browser policy issue. Most modern browsers will block autoplay unless the video is muted, loops, and plays inline, especially on mobile. That’s why this method works so reliably: it follows the rules browsers expect while still giving you true [Divi 5](https://divicake.com/blog/divi-5-release-date-roadmap/) video autoplay for self-hosted MP4 videos.

The best part is how clean and scalable your setup is. By adding the dc-autoplay class through Divi 5 Attributes and placing the script in a Code Module on the same page, the autoplay only runs where you want it. No plugins, no site-wide scripts, and no extra bloat. Just keep your MP4 optimized and short for faster loading, and you’ll have a smooth autoplay experience that’s easy to reuse on any page.

Read More: [Autoplaying Videos in Divi 4](https://divicake.com/blog/autoplaying-videos-in-divi/)

## Quick FAQs

### Does Divi 5 have autoplay in the Video Module?

Not as a built-in toggle, but you can enable autoplay using the method above.

### Will this work with YouTube or Vimeo videos?

No. This is best for self-hosted MP4 videos. YouTube/Vimeo have their own autoplay restrictions.

### Why must autoplay be muted?

Because browsers allow muted autoplay but block autoplay with sound in most cases.

About the author

Written by Divi Cake.

## Submit a comment

Comments are read before they appear. Your email is not published.

Comment

NameEmail

Company website

Submit commentSubmit commentSubmit comment

The comment form needs JavaScript for its spam check.

Thanks. Your comment is waiting for review and will appear here once it is approved.

## Do you need help with …

- [Divi websites](https://divicake.com/divi-website-development/)
- [Divi plugins](https://divicake.com/divi-plugin-development/)
- [Fix a site](https://divicake.com/fix-existing-site/)
- [Beyond Divi](https://divicake.com/beyond-divi/)
- [Technical SEO](https://divicake.com/technical-seo/)
- [SEO content](https://divicake.com/seo-content/)

## Save Annually on Divi

[Save 69% on Divi VIP](https://divicake.com/go/divi-vip/)[Save 69% on Divi Cloud](https://divicake.com/go/divi-cloud/)[Save 69%, Divi Team](https://divicake.com/go/divi-teams/)

## WordPress Hosting & Tools

[100% off on Kinsta for 1 Month](https://divicake.com/go/kinsta/)[Get up to 62% off Bluehost hosting.](https://divicake.com/go/wordpress-hosting-blue-host/)[Save Up to 15% on Rank Math](https://divicake.com/go/rank-math/)[Get 50% OFF on all WPForms plans](https://divicake.com/go/wpforms/)

## More in Tips & Tricks

[

Divi Condition Options Explained

Tips & Tricks6 min read

### Divi Condition Options Explained

How Divi condition options work: show or hide any section, row, column or module by post info, location, user, interaction, device or WooCommerce state.

3 October 2026](https://divicake.com/blog/a-look-at-the-new-divi-condition-options/)

[

Divi Pro Pricing Explained: Is the Bundle Better Than Buying Add-Ons Separately?

Reviews7 min read

### Divi Pro Pricing Explained: Is the Bundle Better Than Buying Add-Ons Separately?

Divi Pro pricing bundles AI, hosting, cloud and support into one plan. See what each add-on costs alone and the point where the bundle stops paying off.

25 February 2026](https://divicake.com/blog/divi-pro-pricing-bundle-vs-addons/)

[

How to Equalize Column Height in Divi 5 (Fix Row/Module Height Issues)

Tips & Tricks3 min read

### How to Equalize Column Height in Divi 5 (Fix Row/Module Height Issues)

Fix Divi column height mismatches through the row flex settings, then match module heights so cards line up on desktop and still stack cleanly on mobile.

23 February 2026](https://divicake.com/blog/equal-column-height-divi-5/)
