Is there a way to prevent Webflow from automatically adding "-2" to IDs in forms in order to avoid manually updating and monitoring the pages?

Published on
September 22, 2023

Yes, you can prevent Webflow from automatically adding "-2" to IDs in forms by utilizing custom code. Follow these steps to achieve this:

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

  2. Select the form element on the page.

  3. In the right-side panel, click on "Settings" (gear icon) for the form element.

  4. In the form settings, scroll down to the bottom and click on "Custom Code".

  5. In the "Before " section, you can add the following code snippet to prevent the automatic addition of "-2" to IDs:

    ```html

    ```

  6. Now, publish your site for the changes to take effect.

By implementing this code, Webflow will stop automatically adding "-2" to IDs in forms. However, it's important to note that this solution might affect the built-in form functionality and may require additional custom code adjustments if you rely on Webflow's built-in form handling. Use this method carefully, and thoroughly test your forms to ensure they function as expected after making the changes.

Additional Questions:

  1. How can I prevent Webflow from adding "-2" to form IDs?
  2. Is it possible to stop Webflow from appending "-2" to form IDs?
  3. Can I override Webflow's automatic appending of "-2" to form IDs?