How to Identify and Remove Unused JavaScript for Better Site Speed?

Topic summary

A Shopify store owner seeks guidance on optimizing site speed by identifying and removing unused JavaScript code, particularly remnants from uninstalled apps.

Recommended approaches:

  • Diagnostic tools: Use Google PageSpeed Insights or Lighthouse to detect unused JavaScript and CSS files that slow performance.

  • Manual code audit: Check theme files (theme.liquid, snippets folder) via Online Store > Themes > Edit Code, as some apps leave behind scripts even after uninstallation.

  • Optimization apps: Consider Shopify-specific tools like TinyIMG or Page Speed Optimizer to automate performance improvements.

The discussion remains open for additional insights or experiences from other users.

Summarized with AI on October 30. AI used: claude-sonnet-4-5-20250929.

Hello everyone,

I am looking for advice on optimizing my Shopify store’s speed. Specifically, I would like to know:

  • How can I identify unused JavaScript code on my site?

  • Are there any recommended tools or methods for finding and removing leftover code from apps?

If you have experience with this or any insights, I would greatly appreciate your guidance. Thank you in advance!

1 Like

Hi @fatemeh

Here are some ways that you can identify and remove unused Javascript:

  • Use Google PageSpeed Insights or Lighthouse – These tools highlight unused JavaScript and CSS, helping you pinpoint problem areas.
  • Manually audit installed apps – Some apps inject scripts even after uninstalling. Check Online Store > Themes > Edit Code and look for leftover app code in theme.liquid or snippets.
  • Try a Shopify speed optimization app – Apps like TinyIMG or Page Speed Optimizer can help streamline performance.
1 Like