Need help with removing unused JavaScript from mobile site?

Need help with removing unused JavaScript from mobile site?

SeanDS
Tourist
4 0 1

How do I remove unused Javascript from our site - it is slowing it down on mobile (circa 50).

 

Desktop is circa 97 when I run a Lighthouse check.

 

Facebook and You tube are the main culprits.

 

Thanks for any help.

Replies 2 (2)

flareAI
Shopify Partner
2405 224 549

Hello @SeanDS

 

This is Gina from flareAI app helping Shopify merchants get $6Million+ in sales from Google Search, on autopilot.


You will need to identify which scripts are causing the slowdowns. You can follow these tips to find them.


1. Use a tool to analyze your site's performance, such as Google's Lighthouse, to identify which scripts are causing the slowdowns.

2. Review your theme's code and identify which scripts are necessary for your site's functionality.

3. Review your theme's code to determine which scripts are necessary for your site's functionality and remove any that are unnecessary.

4. Minimize the size of your scripts by removing any unnecessary code, such as comments or whitespace.

5. Use asynchronous loading for scripts that are not necessary for the initial page load.

6. Optimize your images and videos to reduce their size and improve page load times.

7. Consider implementing lazy loading for images and videos to defer their loading until they are needed.

8. Test your site's performance after making these changes to ensure that the script removal has improved your site's speed and performance.


By following these steps, you should be able to identify and remove any unnecessary JavaScript from your Shopify site, which should help to improve its loading speed on mobile and desktop devices.


Gina

flareAI : Get Sales from Google Search, on Autopilot
$10+ billion in eCommerce on Google Search, every day. Find out how much you are missing

oscprofessional
Shopify Partner
16343 2438 3179

Hello @SeanDS 

In your store, if there is heavy JavaScript calling. so you need to work on it if you are having coding knowledge.

 

  • You need to use Async or defer JavaScript.
  • Check the assets folder of the theme and remove unused JS file
  • Check and remove unused apps.
  • If your store has not installed any app you can comment {{ content_for_header }} code in the theme. liquid (not recommended if you don't have knowledge about the liquid).
Hire us | Pass Core Web Vital | B2B Wholesale Experts | Claim Your Free Website Review |
Connect with Us: WhatsApp | Skype: oscprofessionals-87 | Email: pallavi@oscprofessionals.com |
Custom Shopify SolutionsPrivate Apps, Theme Customization & SEO | Digital Marketing |
OSCP Apps: Discount Suite | Wholesale App | Bundle & Upsell | Shipping Discount | and more...