Skip to content
saif.

A Webflow developer for the custom code your site has outgrown

Saif Ali

Saif Ali, MVP developer7 years across design, Webflow, Next.js and full appsLast updated

In shortI'm Saif Ali, a freelance developer who cleans up and migrates Webflow custom code. Scripts pasted into page settings and Code Embeds move into one tested Git repo, so each fix happens once. Your team keeps building in the Designer. I work from Bengaluru, India, with 7 years across design, Webflow and Next.js. I take 3–4 Webflow projects a month.

Have a Webflow site full of pasted scripts? Tell me about it on a free 15-min call.

Pick any time that suits you, and say it's about your Webflow site. Top Rated Plus on Upwork →

Want to see the method first?Every step, with the code, in my developer guide: Webflow custom code in a repo, loaded per component →
“Saif is a genuine expert in Webflow, custom code and picking the right tech for the job. I'd work with him again without hesitation.”
Tobias Drevenstedt, blocksandcolors, Germany · Webflow & MVP client
Sound familiar?

Signs your Webflow custom code needs a clean-up

Nobody plans it. Each snippet solved one problem on one page, and then it got copied. If two or more of these sound familiar, it's time.

Signs a Webflow site's custom code needs a clean-up, and what each looks like, on one large site or in general
SignWhat it looks like
The same script is pasted on several pagesOn one large siteA lazy background-video loader was identical on 8 pages. A FAQ accordion was on 5, plus 3 variants.
You copy a section to a new page, and it looks right but does nothingIn generalIts script lives in the old page's settings, so it doesn't come along.
Libraries load more than once, or from links nobody controlsOn one large siteEvery new version of one outside package went straight to the live site, because a page loaded it at @latest (a personal npm package). Swiper came from a CDN on about 10 pages, in three different ways. GSAP loaded site-wide as 3.12.2 and again as 3.12.5 on four pages.
Nobody knows which copy is the right oneOn one large site198 blocks of custom code across 52 pages; 143 of them unique.
An edit goes live on the next publish, with no history and no testsIn generalAn edited snippet goes live on the next publish, and nobody can see what changed.
Editors are afraid to touch anythingIn generalNon-technical and new editors can't tell which code a component needs.
Script clean-up and migration

What I do on a Webflow custom code clean-up

The Webflow work I take on: moving the custom code your site already has into one place where it's versioned, tested and safe to change.

  1. Audit your custom code

    I find every script and style block in site settings, page settings and Code Embeds, group the copies, list the libraries and their versions, and rank what to move first.

  2. Move it into a repo

    Each behaviour becomes one small component in a Git repo, with version history and review. One loader in the site head starts it wherever an element carries its custom attribute.

    Element settings › Custom attributes

    Name
    ss-component
    Value
    lazy-video
  3. Test it before it ships

    Automated tests for each component, checks in a real browser, and checks on your staging site with the local build before anything is deployed.

  4. Host it and hand it back

    The code runs on Webflow Cloud, served from your own domain, or on another HTTPS server you control. Then your site is back with your team: to reuse a behaviour on any page, they add one attribute in the Designer, with no code.

Every step is written up, with the code: Webflow custom code in a repo, loaded per component →

One component, one page at a time

How a clean-up works, without breaking the live site

Your site stays live the whole time, and any problem stays on one page. Nothing changes for visitors until a component is tested and deployed.

  1. AuditEvery block of custom code, where it sits and what it copies. You get a ranked list.
  2. Set up the repo and the loaderOne small loader goes in the site head, once.
  3. Move one behaviourIt becomes a component that behaves like the old snippet, and can run next to it on the same page without doing the work twice.
  4. TestI check every change on your staging site before your visitors see it, side by side with the old snippet.
  5. DeployThe change is reviewed before it goes live. Then I check that the new version is the one running.
  6. Remove the old snippet, one page at a timeCheck the attribute, remove the script, publish that page, check it, move on.

Why this order? The old snippet stays until the component is deployed, so a publish by anyone never leaves a page with neither. One page per publish keeps any problem on one page, and the rollback small: undo the change, or put the old snippet back.

One real site

What it did on one large site

From the large corporate site in my developer guide: 198 blocks of custom code across 52 pages. Form validation was the first component; the audit ranked the rest.

  • 8 → 1One component to fix, not 8 copiesThe lazy-video component replaced a snippet copied onto 8 pages.
  • 7 formsOne component for every visitor formForm validation on all 7 visitor forms, as one component, on staging.
  • 1.3 kBPages with no components barely get heavierThe loader, gzipped, on a page with no components.
  • Only where usedPages only load the code they useA phone-number library (about 80 kB, plus a 260 kB validation file) only downloads on pages with a phone field.

What went wrong, and the rule each one left

A migration hits surprises. Here are four from that site, in plain words first, and the rule each one left.

Old snippet + new component

The video broke when both ran

A check against the old snippet caught it before release: the old snippet loaded the video first, and the component then set its sources to the text "undefined". The fix: check again at the moment of loading. A test now runs both together.

Webflow forms

A form sent an extra field

Webflow's form collector picked up a phone country picker's search box and sent it as "Field N". The rule: render dropdowns like that outside the form.

Selectors

Three forms on one page shared an id

The rule: components select by attribute, never by id or class.

Deploys

A deploy that shipped nothing

A pre-release version of the tool that puts the code live exited with no output and no error, so a deploy ran the tests and then deployed nothing. The rule: tools are pinned to exact versions, and every deploy is checked.

Want this for your site? Tell me about it on a free 15-min call.

Book a free 15-min call
For tech leads

For Webflow agencies

You'll judge the method before you judge me, so here it is in short. The guide holds the full code: the inline loader that goes in Webflow, the bundle loader, a sample component, the Vite and Astro configs, and how each change is tested. The setup it describes has Vitest tests for every component, a dev page with stand-in markup, and, on Webflow Cloud, a /scripts/health route that returns the deployed version.

What an agency tech lead asks about the method, and the answers
What you'll askThe answer
Will it fight our designers?No. The contract between the Designer and the code is the attribute. Designers rename classes freely; the code never looks at them.
What if the script fails?The rule: add to Webflow's behaviour, don't replace it. The form component only turns off browser validation once it has started, so if the script fails, the browser's own checks still work. Each component starts inside its own try, so one failure never stops the others.
What about content added after the page loads?Call the loader again on the new markup. It skips roots it has already started.
What about Code Embeds with CMS bindings?In the guide's video example, the attribute goes on the Code Embed element that holds the video. The Webflow API won't read or write embed code that has CMS bindings, and any editor can add an attribute in the Designer without touching code.
Can we test against our real pages?Yes. On your *.webflow.io staging site, ?local in the URL makes that page load the local dev build; if the dev server isn't running, the loader falls back to the deployed build, and production ignores the flag. Control runs of the same checks against the old snippet show whether a difference comes from the new code or was already there.
How do we review changes?One component or fix per pull request, with tests, merged after review.
Our team publishes too. Won't your publish ship their changes?I publish one page at a time. A full site publish also ships everyone's pending changes, so we agree one with your team first. If a page goes wrong, the rollback is small: revert the pull request, or put the snippet back.
Dependencies?Installed from npm with exact versions and bundled. No CDN links, no @latest.
Do we need Webflow Cloud?No. Cloud serves the build from the site's own domain. Without it, any HTTPS server you control works. If it's on another domain, it must send CORS headers that allow your site, because module imports are cross-origin.
How does the loader get in?The head code field (a paid Site plan or a paid Workspace; it takes up to 50,000 characters), or a registered inline script through the Data API v2, from a Webflow App with the custom_code:write scope. The loader is under 2,000 characters, so it also fits the Data API's inline-script limit. The bundle itself isn't registered as a hosted script: a hosted script is pinned to an integrity hash, which would change on every deploy. Until the first deploy, I publish to staging only.

I work from Bengaluru, India. I'm online until 11am US Eastern (8am Pacific), and during most of the UK working day.Top Rated Plus on Upwork →

Honest answer

Do it yourself, or hand it over

You don't need me for this. The method is public. Here's how to tell which way fits.

Do it yourself if…

You have a developer with time to spare. The guide is free and complete, and it has a setup prompt you can paste into Claude.

Hand it over if…

  • nobody on your team owns the custom code,
  • the site is live and busy, or
  • the scripts are tangled enough that you don't know where to start.
Free 15-min call

How to start a Webflow clean-up

  1. Book a free 15-minute call, or WhatsApp me.
  2. Bring your site's address, and the pages where scripts misbehave or get copied.
  3. We talk it through, including price and timing for your site. The call is free, and booking it doesn't commit you to anything.
  4. What I'll need from you: access, which I list on the call. We set it up during the sprint, in your own Webflow, GitHub and hosting accounts.
“Every new project, we came back to Saif. He's professional, and he delivers high-quality work on time, project after project. If you need a web expert, he should be your next hire.”
Justin Alva, Masonary Studios, Bangalore · Webflow client

3–4Webflow projects a month

I charge per sprint. A sprint covers the scope we agree, and fixes or changes after it are charged as new work. Webflow work depends on how much custom code a site has, so there's no set price or timeline. We talk about yours on the call.

You own it: everything is set up in your own Webflow, GitHub and hosting accounts.

I work from Bengaluru, India. I'm online until 11am US Eastern (8am Pacific), and during most of the UK working day.

FAQ

Questions about Webflow custom code

What does a Webflow custom code developer do?

Writes the JavaScript and CSS your site needs beyond what the Designer does, and keeps it maintainable. On my projects that means moving scripts out of page settings into a tested Git repo, one component per behaviour, started by a custom attribute, so behaviour moves with the component to any page.

How do I clean up custom code in Webflow?

Find every block in site settings, page settings and Code Embeds, and group the copies. Move each behaviour into a repo as a component, started by a custom attribute through one loader in the site head. Deploy it, then remove the old snippet one page at a time. The full guide →

Will my site break during the clean-up?

It shouldn't. Each component is built to run next to the old snippet, the old snippet is only removed after the component is deployed, and I publish one page at a time. If something goes wrong, it's on one page, and the rollback is small: undo the change, or put the old snippet back.

Can my team keep editing in the Designer?

Yes. Your editors keep building as they do now. To reuse a behaviour on another page, they add one custom attribute to the element. Classes can be renamed freely, because the code never looks at them.

Do I need Webflow Cloud?

No. Webflow Cloud is the simplest option, but any HTTPS server you control works. For your developer: a server on another domain must send CORS headers that allow your site, and the loader needs a paid Site plan or a paid Workspace, or a Webflow App. The details →

How much does it cost, and how long does it take?

I charge per sprint. A sprint covers the scope we agree, and fixes or changes after it are charged as new work. There's no set price or timeline for Webflow work, because it depends on how much custom code your site has. Tell me about it on a free 15-minute call. I take 3–4 Webflow projects a month.

Can I move Webflow custom code to GitHub?

Yes. Each behaviour becomes one component in a Git repo, such as one on GitHub, with version history and review. One loader in the site head starts it wherever an element carries its custom attribute. The old snippets come out one page at a time.

Who owns the code?

You do. I set up every project in your own accounts: the repo is in your GitHub, the code is hosted on your Webflow Cloud or a server you control, and the site stays in your Webflow account. Nothing lives in an account of mine, so any developer can pick it up later.

Why does a copied Webflow section stop working?

Its script lived in the old page's settings, so it didn't come along. When a custom attribute on the element starts the behaviour, the attribute travels with the element, and the section works on any page.

Why does my Webflow site load so many scripts?

Usually because each snippet was pasted to solve one problem on one page, and then copied. On one large site, Swiper came from a CDN on about 10 pages, in three different ways, and GSAP loaded twice, as 3.12.2 and 3.12.5. In a repo, libraries are installed once and bundled, and a page only downloads the code its components use. A page with no components costs about 1.3 kB, gzipped.

Free 15-min call

Have a Webflow site full of pasted scripts? Let's clean it up.

Tell me about your site on a free 15-minute call. I take 3–4 Webflow projects a month.

Prefer email? saif@imshaiksaif.dev