Skip to content
Pixeltree

Performance

Shopify Theme Cleanup: Code, Liquid, and Asset Hygiene

Pixeltree cleans up Shopify themes by removing dead code, fixing Liquid patterns, and tightening the asset pipeline so themes ship faster and stay maintainable.

What you get

Deliverables, not deliverable-ish.

Scoped plan

Written scope with success criteria, not a vague retainer.

Senior execution

The person scoping the work is the person doing the work.

Measurable output

Deliverables you can point at. Dashboards, flows, code, docs.

Clean handoff

Documentation and training so the work lives inside your team.

How we work

Our approach.

The problem with Shopify themes after two years of edits

A Shopify theme starts clean and gets dirty fast. The first designer makes reasonable decisions. The second designer adds sections. A developer adds a header variant for a campaign that ran two years ago. A marketer installs an app that injects three script tags. The dev who would have cleaned it up leaves, and the next person is told not to touch anything because the site works. Two years later the theme is a graveyard of dead sections, duplicated CSS, and Liquid that nobody understands.

The second failure is the performance cost. Dead code still loads. Duplicated CSS still blocks render. A header variant from 2022 still compiles every time a page renders, even though it has not been visible to a customer since. The theme gets slower by small amounts every quarter, and by the time someone measures, LCP is two seconds worse than it was at launch and nobody knows why.

The third is maintainability. Dirty themes are terrifying to modify. Every change takes twice as long because the developer has to reverse engineer what is load-bearing and what is not. The brand ends up shipping fewer changes per quarter, and the changes it does ship are more expensive. That is a real business cost that does not show up in a performance report.

How Pixeltree runs a theme cleanup

We run a four-step methodology that treats the theme as a codebase and the cleanup as a refactor, with tests.

  • Step one, inventory. We catalog every section, snippet, asset, and template in the theme, flag what is live, what is orphaned, and what is duplicated.
  • Step two, dependency mapping. We trace every section to its usage, every CSS file to its consumers, and every JS file to its entry points. Anything with no consumer is a candidate for removal.
  • Step three, refactor. We remove dead code, consolidate duplicates, rewrite Liquid patterns that are doing expensive work, and tighten the asset pipeline so CSS and JS load with the right priority per page type.
  • Step four, visual regression and QA. We run the cleaned theme against a visual regression suite and a manual QA pass on the top ten page types and the checkout before shipping.

Everything happens on a duplicate theme in staging. Nothing goes live until the section passes QA.

What you get

The theme cleanup engagement delivers a rebuilt theme that looks identical to the live one and loads significantly faster.

  • A theme inventory document with status and recommendation per asset
  • A dependency map for the top sections and templates
  • A cleaned theme with dead code removed and duplicates consolidated
  • A rebuilt asset pipeline with CSS and JS loading prioritized per page type
  • A visual regression report showing pixel-level parity with the current theme
  • A QA signoff covering the top ten page types and the checkout
  • A maintainer runbook so future work does not reintroduce the same debt

The cleanup usually precedes a Core Web Vitals optimization engagement because a clean base makes the CWV work go faster.

Timeline

Most theme cleanups run four to six weeks.

  • Week one, inventory and dependency mapping
  • Weeks two and three, refactor on a duplicate theme in staging
  • Week four, visual regression and QA
  • Week five, incremental deployment to live
  • Week six, stabilization and handoff

Themes with heavy app-injected code or extensive custom sections may extend by two weeks.

Mini case anatomy

A composite from a US accessories brand on a three-year-old Dawn theme. The brand had layered four designers and six developers onto the theme over three years. Page weight on the home page was 5.8 megabytes. LCP on mobile was 4.4 seconds. The dev team was quoting three weeks for a simple banner change because they were afraid of breaking something.

We ran the four-step methodology. The inventory surfaced fourteen sections that were no longer used on any template, six CSS files that duplicated rules, and three JS files that had been superseded by newer apps but never removed. The dependency map showed that a legacy megamenu snippet was being rendered on every page even though a newer header variant had replaced it.

The refactor removed the fourteen dead sections, consolidated the six CSS files into two, and removed the three obsolete JS files. We rewrote a Liquid loop in the collection template that was doing an O of n squared lookup into an O of n pass. We moved three render-blocking scripts to defer and added a preload hint for the LCP image on the home page.

We ran visual regression against the live theme and hit pixel parity on ninety-seven percent of pages, with the remaining three percent being intentional improvements. We deployed incrementally across a week.

Sixty days later page weight on the home page was 2.3 megabytes. LCP on mobile was 2.1 seconds. The dev team's turnaround on a theme change dropped from three weeks to three days because the code was finally readable. Mobile conversion rate lifted by nine percent over the following ninety days.

The lesson was that the theme was not slow because Shopify was slow. It was slow because it had accumulated three years of decisions nobody had ever cleaned up, and the cleanup was cheaper than the brand expected.

FAQs

See also the Shopify speed audit leaf, the image pipeline optimization leaf, the Shopify development hub, and the performance optimization hub.

FAQ

Questions we hear most.

Yes. Cleanup preserves the current design and IA but rebuilds the underlying code. Redesign changes the look and feel. Cleanup is usually what brands need when the site looks fine but performs badly.
We work on a duplicate theme in staging, ship incrementally, and run visual regression tests between versions. Nothing goes to the live theme until a section has passed a full QA pass.
Usually not. Most cleanups happen on the existing theme. We only recommend migration when the base theme is Vintage Dawn or older and lacks Online Store 2.0 support.

Let's see if we're a fit.

15 minutes. We'll tell you whether this service fits where you are. If not, we'll name what does.

Book a 15-min call