Insert Links to YouTube Videos
In Divi 5 I can‘t store pages when I inserted links to YouTube videos. In Divi 4 it works. Does someone have an idea what I should change?
After updating to Divi 5, I can no longer save pages that contain links to YouTube videos.
This affects both:
- existing pages that already contained YouTube video links
- new pages where I add a YouTube video link
What I tested:
- Regular links such as https://example.com can be saved without any issue.
- https://www.youtube.com can also be saved.
- As soon as I insert a full YouTube video URL, for example https://www.youtube.com/watch?v=_gvnI7960k0, the page can no longer be saved.
All In One Security is already deactivated.
As a temporary workaround, I am uploading the videos directly to my WordPress installation instead of linking to YouTube.
Could you please check whether this is related to Divi 5, a known compatibility issue, or a server/security rule triggered by YouTube video URLs?
I haven't tested everything myself yet, but I plan to do so soon. In the meantime, I’ve done some research. Since the cause could range from Divi's own settings to WordPress core or even specific server configurations at the host, it’s not that easy to put together a single solution that works for everyone facing this issue.
So, here is some initial info for you on what you can test on your end. If you can provide some feedback as a reply to this post, I can continue researching and testing. Perhaps other members are experiencing the same problem and can share their workarounds, or maybe others aren't affected at all. I'm curious to see the results. Here is what I've found for you so far:
1. Server-Side Firewall (ModSecurity)
This is the most likely culprit. Divi 5 sends data via AJAX/REST API. Some server firewalls mistake the combination of "YouTube.com" and "HTML tags" for a Cross-Site Scripting (XSS) attack.
- Action: Check your hosting control panel (cPanel/Plesk) for ModSecurity logs.
- Test: Ask your host to temporarily disable ModSecurity or whitelist the specific Rule ID triggered during the save process.
2. Browser Console Inspection (Error 403 or 500)
To confirm it’s a server block, open your browser’s Developer Tools (F12) and go to the Network tab while trying to save.
- Look for: A red entry with a 403 Forbidden or 500 Internal Server Error.
- What it means: If you see a 403, your server is actively rejecting the request because of the YouTube URL string.
3. Divi Safe Mode & Plugin Conflicts
Divi 5 has a new rendering engine that might conflict with plugins that "touch" video URLs (like Cookie Consent tools or Image Lazy Loaders).
- Action: Go to Divi > Support Center and enable Safe Mode.
- Goal: If saving works in Safe Mode, one of your plugins (likely a GDPR/Cookie plugin or a caching tool) is incompatible with how Divi 5 handles external embeds.
4. PHP Environment Limits
Divi 5 is resource-intensive during the migration phase. Ensure your server meets these minimum requirements:
memory_limit: 512Mpost_max_size: 128Mmax_input_vars: 5000 (Very important for long pages with many modules)
5. SSRF & REST API Restrictions
Divi 5 relies heavily on the WordPress REST API to save content.
- Check: Ensure no security plugin (like Wordfence or All In One Security) is restricting REST API access for "unauthenticated" requests or specific endpoints, even if the plugin seems deactivated.
Temporary Workaround: As a stopgap, uploading the video file directly to the Media Library works, but this consumes server bandwidth. The goal should be fixing the URL-based saving issue.
It works now. I changed the php.ini as you recommended. Thank you for your support.
Unfortunately, this error keeps occurring again and again. Sometimes everything works smoothly, and then it doesn’t. So far, I haven’t been able to identify any clear pattern
This is the screen with 4 video elements in the editor.
When I add a YouTube link via a button, the saving process works fine. I tried to reproduce the error but was unsuccessful. I then did some research and eventually consulted various AIs. Based on your screenshot, I received similar answers from different AIs—although not all could read the screenshot directly, so I had to provide a detailed description to get those results.
Unfortunately, I couldn't find any existing references to read up on or sources to share with you that cover this specific topic. I still believe it would be best to demonstrate this to the Divi5 support team, possibly via remote access.
In summary, here is what the issue might be:
With the screenshot, the diagnostic changes:
The text [object Response] visible in the editor is not a server or firewall issue at all. It is a JavaScript bug in Divi 5 itself.
[object Response] is what appears in JavaScript when a fetch() call returns a Response object that is converted directly to a string instead of being properly awaited and parsed (e.g. via await response.json()). In other words, Divi 5's Video module is making an internal fetch request — most likely to resolve the YouTube URL or load an oEmbed preview — and then handling the result incorrectly.
This also perfectly explains the intermittent behavior. Because it is a timing issue (race condition), the result depends on how fast the fetch request completes at any given moment. Sometimes it works, sometimes it doesn't — depending on network latency to YouTube's oEmbed endpoint, server load, or browser state. This is why no clear pattern could be identified.
Recommended next steps:
-
Open the browser Developer Tools (F12) and go to the Console tab before loading the page with the video elements. There should be JavaScript error messages pointing to the exact Divi script and line number. A screenshot of those errors would be very valuable for a support ticket.
-
This should be reported directly to Elegant Themes as a bug. The [object Response] screenshot combined with the console log is solid evidence that this is not a configuration problem — it is a defect in Divi 5's Video module code. Please open a ticket at elegantthemes.com and include: the screenshot, the console log output, the Divi version number, and the reproduction steps (insert a YouTube URL containing ?v= into a Video module).
-
Check whether a Divi update already contains a fix. Elegant Themes has been releasing updates at a high frequency since the official Divi 5 launch, so it is possible this has already been patched in a newer version.
The server-side investigation was a reasonable path to follow, but this screenshot makes the root cause clear: it is a frontend JavaScript issue within Divi 5 itself.