DEV Community

ClearPatch
ClearPatch

Posted on

Why uninstalling a Shopify app leaves dead scripts in theme.liquid (and how to patch Draft .zip themes safely)

If you have ever uninstalled four or five apps from a Shopify store, re-ran PageSpeed Insights, and watched mobile Total Blocking Time barely budge, your theme probably isn't at fault.

The moment you click Uninstall on an older review, popup, or analytics app in Shopify Admin, Shopify immediately revokes that app's API token. Any legacy <script src="..."> tag or {% render %} snippet injected directly into layout/theme.liquid gets stranded behind because the vendor no longer has write permission to clean up after itself. Every mobile shopper still pays that main-thread parse and network cost on every page load.

{%- comment -%}
  Common culprit in layout/theme.liquid after deleting legacy apps:
  The app is gone from Shopify Admin, but its blocking tag still fires on every visit.
{%- endcomment -%}
{%- comment -%} <script src="https://cdn.old-popup-vendor.example/widget.min.js"></script> {%- endcomment -%}
📺 Info Siaran: clearpatch/why uninstalling a shopify app leaves dead scripts in themeliquid and how to patch draft zip jc - Info Live Streaming 2026 📺 Info Siaran: clearpatch/why uninstalling a shopify app leaves dead scripts in themeliquid and how to patch draft zip jc - Info Live Streaming 2026

Why $50/mo "Accessibility Overlays" Make It Worse

At the same time, merchants trying to pass WCAG 2.2 AA and European Accessibility Act (EN 301 549) checks keep getting pitched JavaScript "accessibility overlay" widgets. Those widgets ship another 300KB+ bundle onto the storefront without fixing the actual Liquid or DOM markup underneath:

  • Sub-24px tap targets: Compact 16px color swatches and quantity steppers still fail WCAG 2.2 rule 2.5.8 (24x24px minimum target size).
  • Unlabeled icon controls: SVG-only cart, search, and drawer close buttons still miss accessible aria-label names.
  • Alpha-blended contrast failures: Translucent sale pills over hero photography still fail 4.5:1 computed RGBA contrast.
/* Scoped Shopify Custom CSS (<= 1,500 chars) fixes real DOM metrics with 0 runtime JS */
.product-form__input input[type="radio"] + label,
.quantity__button {
  min-width: 24px;
  min-height: 24px;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
📺 Info Siaran: clearpatch/why uninstalling a shopify app leaves dead scripts in themeliquid and how to patch draft zip jc - Info Live Streaming 2026 📺 Info Siaran: clearpatch/why uninstalling a shopify app leaves dead scripts in themeliquid and how to patch draft zip jc - Info Live Streaming 2026

A Safe 3-Step Workflow Before Touching Live Theme Code

  1. Duplicate or export into an Unpublished Draft first: Never edit live theme.liquid in production. Export your theme .zip (or duplicate it in Shopify Admin) so every change can be tested via ?preview_theme_id.
  2. Audit rendered DOM + third-party network requests: Measure computed foreground/background RGBA contrast across parent alpha layers, check interactive bounding boxes against 24x24px, and flag script domains firing from uninstalled apps.
  3. Comment out dead script tags + apply scoped CSS: Comment out orphaned vendor tags inside the Draft copy and keep accessibility layout fixes inside a compact Custom CSS block instead of adding another third-party script.

Testing this automatically without handing over store logins

I got tired of running those checks by hand and watching small store owners hand over Shopify collaborator access or pay $400+ just to wait two days for a PDF report, so we built ClearPatch and took it live today.

It runs a deterministic, zero-cookie 1-page scan right from the browser (checking leftover ghost scripts, WCAG 2.2 24x24px tap targets, computed alpha contrast, and accidentally exposed client-bundle API keys like unmasked Supabase or Stripe tokens), and lets you drop in a Shopify theme .zip to get back a patched Unpublished Draft .zip in seconds with zero store logins.

If you maintain Dawn or OS 2.0 themes and want to throw a weird storefront URL at the free 1-page check on useclearpatch.com, let me know in the comments if any selector trips a false positive.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.