As documented in https://en.support.wordpress.com/code/
The following tags are stripped from post_content on save for WordPress.com simple sites:
The block editor is not aware of this limitation, and does not show any warnings. This is a confusing user experience so we should make add a nudge or provide an appropriate human readable error.
<iframe> code is not allowed<iframe> code, like: <iframe src="https://staticresource.com" width="300" height="300"></iframe>For the preview to either show an error message, show the code itself, or be blank, as the code will not work on the site
The preview successfully shows the embedded content, inaccurately leading the user to believe the code will work on their site
Reported in #1902396-zen
Just a note, I did some further testing and the same case is happening for other types of disallowed code like <form> as well.
where
Thanks for the report! @lakellie for context, what plan feature is this tied to? The custom html block is part of Gutenberg, so we'll want to make a choice here to still gate on that or not.
Hi @gwwar! Happy to provide more info.
On all simple sites (including Business plan sites which are not Atomic), there are certain HTML tags that are not allowed and will not work on the site. These include embed, frame, iframe, form, input, object, textarea, and script. More info here: https://en.support.wordpress.com/code/
The only way it's possible to use these tags on your site is to go Atomic.
So the issue here is that when these particular tags are used in the Custom HTML block on a simple site, the preview on the block itself shows the code as working, when it won't actually work on the live site. So I wonder if a fix could be pushed out for simple sites only?
Thanks for the additional context @lakellie !
So I wonder if a fix could be pushed out for simple sites only?
Yes, I'll update the issue to reflect that and add it to our backlog!
This was also the cause of confusion in 2827394-zen.
The user's attempting to embed a store from a third-party service and added the needed code to the custom HTML block. Everything looked good in the editor, which caused confusion and led them to going around in a few circles when the store didn't appear on the live site itself.
A dedicated <iframe> or embed Gutenberg block would be nice.
The wordpress personal plan allows lots of different "block" "Gutenberg" embeds, but not an embed (