How can I prevent a Typeform script from displaying on mobile devices in Webflow?

Published on
September 22, 2023

To prevent a Typeform script from displaying on mobile devices in Webflow, you can use custom code and media queries to selectively load the script only on desktop devices. Here's how you can achieve this:

  1. Open your Webflow project and navigate to the page where you want to prevent the Typeform script from displaying on mobile devices.

  2. Click on the "Page Settings" icon in the top navigation menu and select "Custom Code" from the dropdown menu.

  3. In the "Head Code" section, add the following code:

<style>@media only screen and (max-width: 767px) {  .typeform-widget {    display: none !important;  }}</style>
  1. This code applies a media query that targets devices with a maximum width of 767 pixels, which typically represent mobile devices. The display: none !important; property hides the Typeform widget.

  2. Save the changes and publish your Webflow site.

Now, the Typeform script will not be displayed on mobile devices, effectively preventing it from appearing on smaller screens. Users accessing your website on desktop devices will still be able to see and interact with the Typeform widget.

By using this custom code approach in Webflow, you have full control over when and where the Typeform script is displayed, allowing for a better user experience on mobile devices.

Note: Keep in mind that using custom code can have implications on the performance and maintainability of your website. Ensure that you test your website thoroughly across different devices and browsers to confirm that the Typeform script is hidden as intended on mobile devices without causing any issues.

Additional Questions:

  1. How can I embed a Typeform in Webflow?
  2. Can I customize the appearance of the Typeform widget in Webflow?
  3. Is it possible to conditionally load scripts in Webflow based on user interactions?