Opened 4 weeks ago
Last modified 2 weeks ago
#66320 new defect (bug)
kses filter silently strips allowfullscreen from Vimeo and YouTube iframe embeds on every post save, breaking video playback sitewide
| Reported by: | Kim Greenhouse | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Formatting | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | accessibility |
Description
Every time a WordPress post containing a Vimeo or YouTube iframe embed is saved or updated, the kses filter silently strips the allowfullscreen attribute from the embed code in the database. This causes the embedded video to display a privacy/playback error to all visitors with no warning to the site owner — without my knowledge. I never know how long videos have not been working. This is not acceptable.
Steps to reproduce:
Embed a Vimeo or YouTube video in a post using the standard iframe embed code provided by those platforms
Save the post
Visit the post as a visitor — the video displays: “Because of its privacy settings, this video cannot be played here”
Inspect the post content in the database — allowfullscreen has been silently removed
Why this is a defect:
WordPress’s own embed block and oEmbed system generate iframe code that includes allowfullscreen. The kses filter then strips it on save — meaning WordPress is actively breaking its own output with zero warning to the user.
allowfullscreen is not a security risk. It is a standard HTML5 attribute that permits an iframe to enter fullscreen mode. It poses no cross-site scripting risk, no injection vector, and no security concern of any kind. It has been a standard part of the HTML5 specification since 2012.
Real-world impact:
I have operated a professional WordPress broadcast platform since 2009. Over nearly two decades, I have hosted leaders from every major industry — producing close to 300 episodes of long-form video interviews and 300 audio episodes that serve as a permanent public archive. This is serious, professional publishing work on WordPress.
This issue has been silently breaking professional video publishers like me for over a decade. A site with hundreds of video episodes can have every single video broken simultaneously simply because the site owner edited and saved a post for any reason — fixing a typo, updating metadata, adding a transcript. There is no warning. Visitors see broken videos. The site owner has no idea until a visitor reports it.
I want to be more active on my site — updating content, adding transcripts for accessibility and SEO, improving posts. But every time I save a post, my entire video library breaks. This is not a theoretical edge case. This is a recurring, documented failure that is actively discouraging professional publishers from maintaining and improving their WordPress sites.
My site is itsrainmakingtime.ch — a broadcast platform that has been live on WordPress since 2009.
Requested fix:
Add allowfullscreen to the kses allowed attributes whitelist for iframe elements. This is a one-line fix that would permanently resolve a user-hostile bug that has persisted since 2012.
I respectfully urge the WordPress core team to prioritize this fix. Professional publishers deserve better.
Thank you in advance.
Kim Greenhouse
itsrainmakingtime.ch
Change History (4)
#2
in reply to: ↑ 1
@
4 weeks ago
Replying to suryakantupadhyay:
I tested YouTube and Vimeo embeds in Custom HTML blocks and checked the saved content using WP-CLI and browser DevTools.
allowfullscreenwas still present in both, so I couldn't reproduce the issue.
WordPress core KSES doesn't allow
iframeby default, so when filtering applies, it removes the entire iframe rather than justallowfullscreen. Adding the attribute alone wouldn't fix this.
Thank you for testing. I should clarify that my site uses the Classic Editor with the Thesis/Focus theme, not Gutenberg blocks. The behavior may differ from what you tested.
When I save a post in the Classic Editor, the iframe embed code remains intact but the allowfullscreen attribute is specifically stripped — not the entire iframe. The video embed displays but throws a Vimeo privacy error because allowfullscreen is missing.
My workaround is running a database Search & Replace after every post save to restore allowfullscreen. This confirms the attribute is being stripped, not the entire iframe.
#3
@
2 weeks ago
I ran YouTube's and Vimeo's current embed codes through the TinyMCE 4.9.11 parser/serializer that the Classic Editor uses on save (schema as WordPress configures it):
- Default html5 schema:
allowfullscreenis kept, butallow="…; fullscreen; …"andreferrerpolicyare removed on every save. - html4 schema:
allowfullscreenis removed too. A theme or plugin switching TinyMCE to html4 would match what the reporter sees.
kses isn't involved for administrators (unfiltered_html), so whitelisting the attribute there wouldn't help. The core fix looks like adding allow and referrerpolicy to TinyMCE's iframe rule in the wordpress TinyMCE plugin. A stripped referrerpolicy can also explain the Vimeo "privacy settings" error for domain-restricted videos.
@Kim Greenhouse: could you check whether your theme or a plugin sets the TinyMCE schema to html4 (for example through the tiny_mce_before_init filter)?
#4
@
2 weeks ago
I ran YouTube's and Vimeo's current embed codes through the TinyMCE 4.9.11 parser/serializer that the Classic Editor uses on save (schema as WordPress configures it):
- Default html5 schema:
allowfullscreenis kept, butallow="…; fullscreen; …"andreferrerpolicyare removed on every save. - html4 schema:
allowfullscreenis removed too. A theme or plugin switching TinyMCE to html4 would match what the reporter sees.
kses isn't involved for administrators (unfiltered_html), so whitelisting the attribute there wouldn't help. The core fix looks like adding allow and referrerpolicy to TinyMCE's iframe rule in the wordpress TinyMCE plugin. A stripped referrerpolicy can also explain the Vimeo "privacy settings" error for domain-restricted videos.
@Kim Greenhouse: could you check whether your theme or a plugin sets the TinyMCE schema to html4 (for example through the tiny_mce_before_init filter)?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I tested YouTube and Vimeo embeds in Custom HTML blocks and checked the saved content using WP-CLI and browser DevTools.
allowfullscreenwas still present in both, so I couldn't reproduce the issue.WordPress core KSES doesn't allow
iframeby default, so when filtering applies, it removes the entire iframe rather than justallowfullscreen. Adding the attribute alone wouldn't fix this.