How to avoid loading irrelevant JS files in Shopify in 2025?

How to avoid loading irrelevant JS files in Shopify in 2025?

mfcss
Explorer
66 6 28

I periodically try to optimize our Lighthouse page speed score and previously managed 90+ scores for all our pages. Since then, however, Shopify has introduced a ton of new JS/CSS files that load and seem to reduce all our page scores to the 60-70 level.

 

See e.g. the below screenshot of a number of JS files that are completely irrelevant to us (we e.g. do not use Prime, Google Pay, Rage Click and whatever all the other stuff is):

mfcss_0-1737036669499.png

 

In addition, I could previously use a liquid script ala below to remove JS files from loading on e.g. my non-product pages - but this no longer seems to work, as if Shopify potentially removed the ability to capture the content header at all. Anyone who has found a work around?

 

{% capture h_content %}
{{ content_for_header }}
{% endcapture %}

{{ h_content | replace: '\/\/d1liekpayvooaz.cloudfront.net\/apps\/customizery\/customizery.js?shop=xyz.myshopify.com', ''}}

 

Reply 1 (1)

EstherBui
Trailblazer
276 39 44

Hi Mfcss

The JS files are loaded according to each theme's setup. However, the score on Lighthouse may not fully reflect the store's actual speed. Generally, a store only needs a score of 50 on mobile and 80 on desktop for good performance.

In my opinion, you should minimize the use of third-party apps, avoid putting too much content on a single page, and refrain from using external libraries like jQuery. This will help ensure the store has the best possible speed.

Best, 
Esther

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!