How can I prevent the auto-redirect of the embedded iframe's URL on my Webflow /events page?

Published on
September 22, 2023

To prevent the auto-redirect of the embedded iframe's URL on your Webflow /events page, you can use the sandbox attribute and specify the allow-scripts value. Here's how you can do it:

  1. Open your Webflow project and navigate to the page where you have the embedded iframe.

  2. Select the HTML embed element that contains your iframe.

  3. In the right-hand sidebar, go to the "Settings" tab.

  4. Scroll down to the "Attributes" section and click on the "+" sign to add a new attribute.

  5. In the "Attribute name" field, enter sandbox.

  6. In the "Attribute value" field, type allow-scripts. This will sandbox the iframe and prevent scripts from running in it.

  7. Publish or update your Webflow site to apply the changes.

By adding the sandbox attribute with the allow-scripts value to the HTML embed element containing your iframe, you are restricting the iframe from executing any script, including auto-redirects.

Please note that by using the sandbox attribute, you are also restricting other permissions that may be required by the iframe, such as accessing cookies, submitting forms, or playing media. Make sure to evaluate the requirements of the embedded iframe and adjust the sandbox configuration accordingly.

It's important to consider the implications of blocking scripts as it may affect the functionality and user experience of the embedded content.

Remember to test your webpage after making the changes to ensure that the auto-redirect of the embedded iframe's URL is prevented successfully.

Additional resources: