How To Clear Unused Codes in Shopify After App Uninstall

How To Clear Unused Codes in Shopify After App Uninstall

One of the most common issues in Shopify is the files or codes that are left after uninstalling the Shopify apps from your store. You may have not realized it already but this issue will not only slow down your store but it will also make your theme files super unorganized.

How To Clear Unused Codes in Shopify After App Uninstall

Luckily, Shopify is working on fixing this issue through app snippets but the sad news is… it’s not yet available for the developers, so this problem will surely be around for a few more months.

But how do you actually remove the unused files from your Shopify store?

Today, we’ll be giving some tips on how to clear out the unused codes (or files) from your Shopify store after uninstalling the Shopify apps.

Getting Started

Before we provide the tips that you need for getting rid of the files from your Shopify store, make sure that you actually know your way around of your Shopify store especially with the theme files. Also…


Always backup your theme files!


It’s important to remember that once you have deleted a file from your store, you won’t be able to retrieve it unless you have a backup.

If you feel like you have all of your files protected then let’s get started.

Video Tutorial

The video tutorial below will guide you how to remove unused files or codes from your Shopify store specifically the ones that were installed by the apps that you have installed/uninstalled.

How To Remove Unused Codes From Your Shopify Store

The following are the steps that you can follow to remove unused codes or files from your Shopify store.

1. Scan through your theme.liquid file

Search for lines of codes that begins with the following:

{% includeCode language: PHP (php)

Let’s give you an example, here is the bottom part of our theme.liquid file.

Shopify theme code editor

In the image above, we have the line of code that is referencing the asset file sumo.liquid.

Now let’s check if this is a file from Shopify or not?

2. Check if the file came from an app or not

To check if the file is from a Shopify app, just simply type in the Google search Shopify <keyword> app.

For example:

Shopify app google search

And right below, we have the result which confirmed that it is from the Shopify app Sumo.

Searching for Shopify apps in Google

3. Check if the app is installed in the store

The next step is to check if the app is installed in your store.

Go to your Shopify store admin page > Apps

Then, scroll through and look for the app that contains the word sumo. If there’s no app, then that means the file sumo.liquid is unused.

We highly recommend double-checking because there are cases that the file is being used by a different app but developed by the same company. So again, delete the file at your own risk.

4. Remove the code & file

Once you have found that the code/file came from the uninstalled app, then it’s time to remove it from your theme.

Just open your theme.liquid file again and just remove the line:

{% include 'sumo' %}Code language: PHP (php)

Then save the file.

5. Check if the changes you made caused an error

Once you have saved the file, open your Shopify store, navigate thoroughly around your store and check in the browser console if there is an error.

Checking if Shopify has an error

If there’s no error in each page then that means the file is safe to be deleted. Again, delete at your own risk.

How To Find Unused Files in Shopify

Looking for the unused files in your Shopify app is very easy. By using Google PageSpeed Insight, you can find all of the files from your Shopify store that are loaded but not being used.

Just type your website URL and scroll down and look for Remove Unused Javascript.

Google Page Speed Insights for Shopify

Underneath of it you will see a list of files that are being loaded in your store but is not being used by your store. You may verify each of the files by following the steps provided above.

Conclusion

Working as a merchant in Shopify can truly be tiresome especially if you’re doing everything just on your own.

Luckily, there are hundreds of Shopify apps that you can install so you won’t have to deal with so much stress. The sad thing is, the more apps you install, the more your store becomes slower. When you remove the apps, the apps leave some files that still makes your store super slow.

We highly recommend listing down all of the apps that you installed from the start, that way you’ll have a record which one is installed and which one is uninstalled. You may also check the app’s company page since they usually have a documentation about how to delete the files that the app installed in your store.

Leave a Reply