FROM CACHE - en_header

Removing Code From a Deleted App

Solved
dsuarez
New Member
1 0 0
Hi everyone,
 
There seems to be some leftover code from an App (Easy Location) we tested out for the country redirects. It is causing a file not found error:
Does anyone know how to remove this code?
 
Thanks!
Accepted Solution (1)

Accepted Solutions
JoesIdeas
Shopify Expert
1691 146 435

This is an accepted solution.

You'll have to do some investigation to find the code, but since it's on the product page, here's how you can find it:

1) Open the product.liquid template and read the code to see if the code is in that file.

2) If not, check the {% include %} and {% render %} statements to find included sections / snippets. Then read those files.

Another way you can approach it is to download your theme files, then do a search in the folders for either the text that shows, or if you can't find that you can inspect the code in the browser to identify an ID or a class associated with the code. You can learn about inspecting the site in this guide: https://speedboostr.com/finding-and-fixing-console-errors/

• Creator of Order Automator (automation app to save you and your team time on admin tasks)
• Shopify developer for +10 years
• Contributor on the Speed Boostr blog
• Guy who likes to help people

View solution in original post

Replies 8 (8)
JoesIdeas
Shopify Expert
1691 146 435

Check your theme.liquid file in the theme editor. That's usually where app code is added.

Shopify revokes access the second you delete an app, so they can't auto remove it. If you can't find the code, email the app developer, they can tell you how to remove it. Also a nice move is to recommend them to auto-send an email on app delete, with uninstall instructions so others aren't stuck with old app code loading in the future. All app devs should be doing that.

• Creator of Order Automator (automation app to save you and your team time on admin tasks)
• Shopify developer for +10 years
• Contributor on the Speed Boostr blog
• Guy who likes to help people
gurubaba
New Member
1 0 0

Hi, I also deleted an app and but the code is still in there and I have no idea how to delete nor can I remember what the app was called that I used?

This is the bit I am trying to delete in red

Screenshot 2021-03-02 at 21.40.34.png

 

 

JoesIdeas
Shopify Expert
1691 146 435

This is an accepted solution.

You'll have to do some investigation to find the code, but since it's on the product page, here's how you can find it:

1) Open the product.liquid template and read the code to see if the code is in that file.

2) If not, check the {% include %} and {% render %} statements to find included sections / snippets. Then read those files.

Another way you can approach it is to download your theme files, then do a search in the folders for either the text that shows, or if you can't find that you can inspect the code in the browser to identify an ID or a class associated with the code. You can learn about inspecting the site in this guide: https://speedboostr.com/finding-and-fixing-console-errors/

• Creator of Order Automator (automation app to save you and your team time on admin tasks)
• Shopify developer for +10 years
• Contributor on the Speed Boostr blog
• Guy who likes to help people
aliciam
Tourist
3 0 7

Im a little disappointed in how much leftover code is remaining after I try and uninstall apps. When I first signed up for Shopify they encourage you to try apps without this warning and theres not enforcement to the apps to help you or guide you on how to remove their code. My site loads slow and I cannot pinpoint whats causing it but can assume its from apps that I no longer use. Right now I only have essential apps to run my site. What is the best solution? Thanks 

JoesIdeas
Shopify Expert
1691 146 435

@aliciam most times if apps put code in your site it's in the theme.liquid file. I would do this:

1) Duplicate your live theme.

2) On the new backup theme, open the Layout file theme.liquid.

3) Read the code and look for anything that references an app that you used to use (for example you might see something like {% render 'some-app-name' %}). Delete that code.

4) After you're done editing, preview the theme just to make sure all is still good.

I agree it's frustrating, the problem is that when you delete an app Shopify immediately revokes access so the app can't clean up. We've requested Shopify to allow app developers a window of time to remove their code, hopefully they'll make this change someday but in the meantime my recommendation is that if an app doesn't send an email to you when you delete it, then contact them to see if you need to take any action to remove their code.

• Creator of Order Automator (automation app to save you and your team time on admin tasks)
• Shopify developer for +10 years
• Contributor on the Speed Boostr blog
• Guy who likes to help people
aliciam
Tourist
3 0 7

Thank you for the fast response. I agree it’s so frustrating. Although I like your idea I would be afraid I erased pieces of an app I want to keep installed. I’m like many folks with shops who aren’t super comfortable messing with that code in fear of making a big error. Thank you for your help! 

RachidBrasil
New Member
1 0 1

it´s very frustrating, i also tested many apps, choose only a few, and now i´m afraid to remove lots of trash code inside my theme.

Plese, SHOPIFY? It´s 2021.

emk_14
New Member
1 0 0

Hi

If you struggle to remove the code yourself, you could try someone at Fiverr to do it for you. I have used professionals there who charges from $5 to do work like that.