Hi cicini,
WordPress removes iframes by default – they are a big security risk. Iframes are also not responsive, meaning that they will likely look terrible on phones, possibly even breaking your layout.
If you are trying to use an iframe to embed a youtube video or similar, then I have good news. You don’t need to use an iframe. WordPress is compatible with something called oembed. Basically, all you have to do is paste the URL for the video and WordPress will automatically convert it into a responsive video!
If you are trying to use an iframe for some other purpose, let me know. I can provide instructions on how to edit HD Quiz to remove the security and allow iframes, but this is obviously done at your own risk.
Thread Starter
cicini
(@cicini)
Oh, I didn’t know wordpress would remove it automatically because I can add it normally when I use the shortcode block in the Gutenberg editor.
Actually I’m trying to embed a page written by me, not a video, it’s like a Steam banner.
Please teach me how to turn off the restriction if you can, thank you.
Thread Starter
cicini
(@cicini)
This page is automatically generated based on nextjs, so I can’t use HTML instead.
First, a disclaimer. The following modification is not recommended or supported in any capacity. Any user who makes the following modifications to HD Quiz does so at their own risk.
Edit ./hd-quiz/includes/functions.php and comment out line 618.
So change
$fields[$key]["value"] = wp_kses_post(stripslashes(urldecode($v["value"])));
to
// $fields[$key]["value"] = wp_kses_post(stripslashes(urldecode($v["value"])));
This will disable sanitization for the wp_editor fields used by HD Quiz, so it should go without saying, but be SUPER careful with whatever data you put in your result texts!