html – Can you embed an iframe tag with any arbitrary source on WordPress?-ThrowExceptions

Exception or error:

I’ve been looking around, and have tried to include a HTML block within the WordPress editor. However, when I continue to preview the page the iframe gets removed. It seems to work for certain sites that have an embed code (e.g. YouTube), but other sites don’t show up.

iframe that works:

<iframe width="560" height="315" src="https://www.youtube.com/embed/IkOVe40Sy0U" 
frameborder="0" allow="accelerometer; 
autoplay; encrypted-media; gyroscope; 
picture-in-picture" allowfullscreen></iframe>

iframe that does not work:

<iframe width="560" height="315" 
src="https://www.bing.com" frameborder="0" 
allow="accelerometer; autoplay; encrypted-media; 
gyroscope; picture-in-picture" allowfullscreen></iframe>

Is there a restriction to the source of the iframe that WordPress filters? Is it possible to render an iframe for any source?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *