Webflow sync, pageviews & more.
NEW

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

TL;DR
  • Webflow will automatically clean malformed or unused custom code during publishing and backups, showing warnings for issues like missing tags or invalid structures.
  • To prepare, review and properly close all tags, validate syntax, use Embed elements appropriately, and back up clean code snippets externally.

Webflow is updating its custom code cleanup process to make your websites faster, more secure, and easier to maintain by automatically removing unnecessary or invalid code. Here’s a breakdown of how it works.

1. What Is Changing

  • Webflow will automatically clean malformed or unused custom code during publishing and backups.
  • A warning or error message will appear if your custom code has:
  • Missing closing tags
  • Invalid HTML structures
  • Scripts that violate Webflow security policies

2. When It Happens

  • During site publish: Webflow checks the custom code sections (Site Settings → Custom Code, Page Settings → Custom Code, and Embed elements).
  • When restoring backups: Webflow ensures the restored version uses only clean and valid code.

3. How to Prepare

  • Review your custom code for any broken tags or old, unused scripts.
  • Close all tags properly (e.g., make sure every <div> has a closing </div>) and verify syntax.
  • Use Embed elements properly if you need to add controlled snippets inside the Designer.

4. What Will Be Affected

  • Code embedded in the Designer via Embed components.
  • Custom Code areas for the entire site or specific pages.
  • Any invalid code may be automatically commented out or removed if it compromises the publish process.

5. Tips for Managing Custom Code

  • Use browser developer tools or online validators to test your code before inserting into Webflow.
  • Prefer using Webflow's native integrations (like Google Analytics, reCAPTCHA) when possible to reduce reliance on custom embeds.
  • Regularly back up your clean code snippets externally in case manual restoration is needed.

Summary

Webflow is enhancing the custom code cleanup process to automatically remove invalid or problematic code during publishing and backups. To avoid disruptions, carefully review and clean your custom code now, ensuring it's properly structured and secure.

Rate this answer

Other Webflow Questions