Webflow sync, pageviews & more.
NEW

In Webflow, how can I hide specific elements in the footer (such as "Ramin Khaze The Difference" and "Schedule showing") when the URL contains a certain parameter, such as "?mls"? I am a beginner in coding and would appreciate any help. Thank you!

TL;DR
  • Add a data-hide-on-param="mls" custom attribute to the footer elements you want to hide in Webflow.
  • Insert a script in the site's custom code that detects the ?mls URL parameter and hides those elements on page load.

To hide specific footer elements in Webflow based on a URL parameter (like ?mls), you can use a small amount of custom code with native Webflow features.

1. Use Custom Attributes to Identify Target Elements

  • In Webflow Designer, select each element you want to hide (e.g., a text block or link block).
  • In the Settings panel (gear icon), scroll to Custom Attributes.
  • Add a new attribute with:
  • Name: data-hide-on-param
  • Value: mls (or any identifier you prefer)

This marks the elements as conditionally hidden.

2. Add Custom Code in the Page or Site Settings

  • Go to Page Settings (or Project Settings > Custom Code if you want this behavior site-wide).

  • Scroll to Before tag and paste the following:

    (Note: This script is beginner-friendly and automatically checks the URL for the mls parameter.)

    ```javascript

    ```

  • Click Save and Publish your site to test the changes live.

3. Test the Behavior

  • Load your published site with the ?mls parameter in the URL. Example:
  • https://your-site.webflow.io/?mls
  • The elements with data-hide-on-param="mls" will now be hidden on load.
  • When the URL does not contain ?mls, the elements will be visible.

Summary

To hide footer elements based on a URL parameter, add a custom data-hide-on-param attribute in Webflow, and use a small script that listens for ?mls in the URL. This approach is low-code and works well for beginners.

Rate this answer

Other Webflow Questions