Repository navigation
Description
Description
I have a website with a number of videos embedded from Wistia. Recently all the ones embedded using oEmbed have broken, instead showing a blurry placeholder image.
This error appears in the console: Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag.
I think it's related to this pull request: #77212
I'm unsure whether this is something that needs reporting here or to Wistia directly. From reading through the pull request it sounds like the allow-same-origin flag has been removed for security reasons, and the pull request says "A new allowSameOrigin boolean prop (default false) controls the iframe's isolation level" but I'm not sure whether I can set that to true within my site, or whether it's something Wistia needs to do at their end?
Step-by-step reproduction instructions
Create a new post.
Paste a link to a Wistia video in the post content area, e.g. https://financeconnect.wistia.com/medias/vop0tim0lp
Video does not display either in the admin area or on the front end, instead showing a blurry thumbnail.
It can be seen on the live site here: https://finance-connect.com/fca-redress-scheme-clarity-at-last-but-real-test-is-delivery/
Screenshots, screen recording, code snippet
Environment info
- WordPress version 7.0.
- Gutenberg not installed.
- The site uses a custom theme based on Underscores but the issue is also present using the Twenty TwentyFive theme, and with all plugins deactivated.
- The issue is present in all browsers and on all devices.
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Activity
talldan commentedon May 28, 2026
cc @alecgeatches
alecgeatches commentedon May 28, 2026
@fionchadd I checked your link and I'm seeing this error on the front-end page:
#77212 should only apply to embeds rendered within the post editor:
It's possible that there still could be a problem here from the Gutenberg end, but it seems like the Wistia script is hitting a different issue on the front-end unrelated to the recent oEmbed changes in the editor.
fionchadd commentedon May 29, 2026
@alecgeatches ah thank you for the clarification! I’d missed the bit in that pull request about it only affecting the back-end. I’ll push Wistia to look into it from their end.
fionchadd commentedon Jun 1, 2026
@alecgeatches Hi Alec, I've heard back from Wistia who say they don't add the "sandbox" attribute to the embed themselves, and they think this is being added by WordPress, in which case the "allow-same-origin" flag also needs to be added by WordPress in order for the embed to work correctly.
I know you said the 77212 change should only apply to embeds rendered within the post editor, but these Wistia embeds did previously work on our WordPress site and have only recently stopped working. Have there been any other changes to the embed block that you know of that may have caused this? & is there any way for me to reintroduce the "allow-same-origin" flag or can you let me know how to change the allowSameOrigin boolean from false to true?
Thanks
Hannah
Mustafabharmal commentedon Jun 1, 2026
Hi! I've investigated this issue and identified the root cause. WordPress core's
wp_filter_oembed_result()addssandbox="allow-scripts"to iframes from untrusted oEmbed providers (Wistia is not in WordPress's trusted provider list). In the editor, this sandboxed HTML is rendered inside theSameOriginSandBoxcomponent. The inner Wistia iframe's explicitsandbox="allow-scripts"attribute overrides the outer sandbox'sallow-same-origin, giving the inner iframe a null origin and blockinglocalStorage.fionchadd commentedon Jun 1, 2026
Hi @Mustafabharmal - thank-you, that's very helpful! I did follow Wistia's instructions in terms of adding it as an oEmbed provider, so I have this code in the functions.php file of my theme:
wp_oembed_add_provider('https://.wistia.com/', 'https://fast.wistia.com/oembed');
Should that negate the issue, or is there something else Wistia need to do at their end to ensure that their videos embed correctly?
Mustafabharmal commentedon Jun 1, 2026
Hey @fionchadd, I checked this further and found that most of the Wistia videos are working fine as expected. The issue seems to be specific to this particular video/account configuration rather than the block or any WordPress code changes.
I noticed that this embed is being rendered differently compared to the working Wistia embeds, which usually happens when the video has some privacy or embed restrictions enabled in Wistia.
Could you please check the Wistia video/account settings for things like:
I suspect one of these configurations is causing the issue.
fionchadd commentedon Jun 2, 2026
@Mustafabharmal Ah thank you so much for checking other Wistia videos, that's very helpful to know that other embeds are working as normal. I'll dig further into our configuration to work out what the issue is, but it doesn't sound like a WordPress bug in that case.
Thanks so much for your help troubleshooting this :)