Tending your Shopify store to weed out old app code before it causes problems

I review a lot of Shopify stores each week.

One thing that comes up time and time again is old code lying around from apps that have been uninstalled.

For back office only apps like my Repeat Customer Insights that don't touch the storefront, uninstalling is simple and clean. It's rare that code gets left behind.

But for apps that have to be in the storefront, visible to customers, or that need theme edits, things get tricky.

Sometimes this code is useful to keep around post-uninstall (like in JSON-LD for SEO's case) or sometimes the code doesn't run after the app is removed, but other times it can cause problems.

The reason Shopify apps leave old code around is because of how Shopify works when you uninstall an app.

From the moment an app is uninstalled in Shopify's admin area, Shopify blocks the app from doing anything in your store. That means apps aren't given the chance to cleanup or remove anything even if they wanted to.

Shopify's recommends using things called ScriptTags but that's only for JavaScript, it doesn't support Liquid. (Don't worry what ScriptTags actually are, they are a developer thing an app can use)

Some features just can't work using JavaScript either. JSON-LD data added via JavaScript is rejected by Merchant Center and adding visible things using JavaScript causes a delay and jerkiness that customers can see.

Plus JavaScript and ScriptTags are the #1 source of major site performance problems in Shopify (e.g. loading 99 versions of the same JavaScript code, slow app servers slowing down stores).

There really isn't a good solution to this problem.

The best one I've found is two-fold:

  1. apps need to provide easy to find and clear directions on how to clean things up after uninstalling
  2. you and your team need to remember to find and follow the full uninstall directions

It might also be a good time to give your store a spring summer cleaning and ask your theme developer to double-check for any stray code.

Eric Davis

Would you like to get a daily tip about Shopify?

Sign up for Eric's Daily Shopify Tips to get my daily email with a tip for Shopify every morning.

Each tip includes a way to improve your store: customer analysis, analytics, traffic, SEO, customer acquisition, Rich Results, CRO... plus plenty of puns and amazing alliterations.

Plus you'll get free access to my Premium Resource Center for free.

Join 4,400+ other Shopify store owners and sign up before the next tip is sent.

I won't send you spam. Unsubscribe at any time. Powered by ConvertKit

Topics: Site speed Shopify apps

Would you like a daily tip about Shopify?

Each tip includes a way to improve your store: customer analysis, analytics, customer acquisition, CRO... plus plenty of puns and amazing alliterations.