What changes are Webflow making to the custom code cleanup process?

TL;DR
  • Webflow now auto-detects and excludes unused custom code during publishing to improve site performance and reduce clutter.  
  • This non-destructive update keeps all code in the Designer for reference while minimizing live site load times and HTML size.

Webflow is introducing an improved process for managing and cleaning up unused custom code snippets across your site. This update focuses on helping users optimize performance and reduce clutter in their projects.

1. Scope of the Custom Code Cleanup Update

  • Targets unused site-wide and page-level custom code (such as scripts added in the Page or Site Settings).
  • Focuses on both embed elements and custom code blocks in Project Settings or within individual pages.
  • Removes orphaned or deprecated code that is no longer linked to rendered pages.

2. When and How It’s Applied

  • Webflow automatically detects custom code that’s not referenced or used during publishing.
  • During the publish process, if custom code is determined to be irrelevant (i.e., not used on live pages), Webflow will exclude it from the published code output.
  • This is a non-destructive change, meaning the code remains inside the Designer and Project Settings but is simply not loaded live if unused.

3. Performance Benefits

  • Faster page loads by avoiding unnecessary scripts or styles.
  • Cleaner published HTML with reduced clutter and lighter file sizes.
  • Improved stability and maintainability, especially for larger projects with legacy code or many contributors.

4. What You Should Do

  • Review your project’s custom code regularly (in both the Page Settings and Project Settings > Custom Code tabs).
  • Remove any code you’re no longer actively using.
  • Use Webflow’s publish preview and staging environments to verify what code runs on each page.

5. Known Limitations

  • Does not yet support identifying conditionally loaded code (e.g., based on user role or interactions)—be cautious if scripts are dynamically injected or referenced via CMS.
  • Custom code inside rich text fields or CMS items is not affected by this cleanup.

Summary

Webflow’s new custom code cleanup process improves site performance and code hygiene by excluding unused custom code during publishing. The code is not deleted, just excluded from the final output, helping keep your live website lean while retaining all code in the Designer for reference or future use.

Rate this answer

Other Webflow Questions