How to remove unused java script and make website faster

How to remove unused java script and make website faster

Nahidul
Visitor
1 0 1

hey tech enthuisist out there my store speed gradually decreasing. i have tried to remove java script and files but i cant find which java script should i remove. im giving below ss of my java script and apps i use. please tell me how to increase my website speed.

thanks in advance.

Screenshot (127).pngScreenshot (129).pngScreenshot (130).pngScreenshot (128).png

Replies 5 (5)

speedboostr
Trailblazer
136 20 26

@Nahidul I have a few resources and suggestions for you:

 
1) The tools my team uses (speedboostr.com, Shopify optimization focused team) are:
Shopify Analyzer to see what can be optimized on your site, plus a scoring system based on over 1,500 Shopify sites we've optimized. We built the tool as a free resource for the community.
WebPagetest.org to measure load speed, number of requests, and page weight. Especially useful for before / after benchmarks when you're doing an optimization project. We've found this tool to be the most reliable measurement for load speed.
Pingdom to see an overview of resources from various domains + a waterfall view to identify bottlenecks in your page load.
2) I recommend starting by running your site through the Shopify Analyzer, that will give you a quick and easy view of the most important aspects for optimizing your Shopify site. From there, if you still feel your site is slow you can have a developer implement more advanced tactics like app optimization (conditional loading, removing old app code, coding features directly into your theme).
3) There's not an app that will handle all optimization aspects, you need a human to do it well. There are some apps that can help assist, like image compression apps (here's how to compress images by the way, both manually or with an app: https://speedboostr.com/how-to-compress-images-on-shopify). Your collection images are huge.
4) Instead of a hero slider or carousel, try one single large hero image.
 
Good luck on your project. If you need professional help feel free to contact my team at speedboostr.com/contact. Our developers optimize Shopify sites every day.
Creator of Theme Scientist (A/B testing app and theme scheduler). Creator of Shopify Analyzer (1st performance analysis tool for Shopify, free for the community). Founder of Speed Boostr (Shopify optimization experts + app developers). More apps from our team: Tip Jar (add a tip button), File Optimizer (optimize CSS, JS, Liquid).
oscprofessional
Shopify Partner
16343 2438 3179

@Nahidul ,

 

Remove unused CSS and unused JS:

 

  • Check assets folder of the theme and remove unused CSS and JS file
  • Check and remove unused apps
  • If your store has not install any app you can comment {{ content_for_header }} code in theme.liquid (not recommended if you don't have a knowledge about the liquid)

share your store URL I will check and let you know.

Thank you!

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...

Cedcommerce
Shopify Partner
718 77 116

Hello @Nahidul

 

There are various methods to increase your Shopify store speed. You can read about them here.

 

 

 

Also, we have a few suggestions based on your query. Hope this gets your issue resolved.

 

The render-blocking resources are caused by both javascript and CSS files.

For CSS, you can preload the CSS files as shown in the example below:  

<link rel=”preload” as=”style” href=”{{ ‘css_file.css ’ | asset_url  }}”/>

and then add the CSS normally you do in Shopify: 

<link rel=”stylesheet” href=”{{ ‘css_file.css ’ | asset_url  }}”/>

 

For Javascript files, you can use async and defer attributes to the script tag to remove the issue. 

 

Async - the async attribute lets the script be executed asynchronously with the rest of the page ( the script would be executed as the webpage parsing continues).

 

<script src=”{{ ‘script_file.js ’ | asset_url  }}” async></script>

 

Defer - the defer attribute ensures that the script has to be executed only after the page has finished parsing. 

 

<script src=”{{ ‘script_file.js ’ | asset_url  }}” defer></script>

 

Using the above code ensures that the render-blocking issues are removed from the script files.   

 

Reduce unused javascript issues can be fixed only when you have template-specific files. In Shopify, we have js files such as theme.js, and vendor.js, which are almost called throughout, and we cannot do anything about that because if you modify these js files, it can lead to malfunction in the website. 

 

If you have not handled Shopify theme and liquid.code earlier, and wish to remove unused javascript issues coming through the Facebook sales channel script and google tag manager, you can connect with us or hire a Shopify expert agency who can help you with these problems.

 

Hope it gets resolved. Let us know if you need any other help.

 

All the best,

CedCommerce

CedCommerce || Shopify Expert
- Let us know if our reply is helpful for you. Like it.
- Was your question answered? Mark it as an accepted solution.
- For further discussion contact: Email ID- apps@cedcommerce.com
- Whatsapp:- Join Here

flareAI
Shopify Partner
2405 224 549

Hello @Nahidul,


This is flareAI: your Fully Automated Free Sales Machine. I hope you're having a good day. flareAI is helping lots of successful Shopify stores generate $5+ million in sales from Google Search, on autopilot.


If my suggestions is helpful to you, please let me know by giving a like or marking it as a solution.


I advise you to run the Shopify Theme Inspector for Chrome to identify the lines of code that are slowing down pages in your online store.


Themes contain CSS, JS, HTML which can increase and affect your store speed. So disable theme features you don't use.


Remove all unwanted Shopify Apps which you are not using. If you are removing an app make sure to remove the code that was added as part of the app install process.


1. Mostly the app code will be in theme.liquid file. So take a backup of the theme.liquid.
2. Check if the app name exists in the file OR search for lines of codes that begins with the following:
{% include 'the app name' %}
3. If you find any hits, carefully remove the code
4. Save the file and also check if the changes you made caused another error


Also, minifying CSS and JS files will help speed up the store page load.


Is your eCommerce sales growing, but profit shrinking? flareAI will help to scale your site sustainably at NO Agency fees, NO Pay-per-click, NO paid marketplaces. With flareAI, your site can access the world's dominant Free eCommerce services in one Shopify App.


If you found the answer helpful consider supporting the Shopify Community by giving it a Like + Accept the solution.


Gina
flareAI

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

OneCommerce
Shopify Partner
253 19 110

After checking, there are some suggested solutions that you can apply to improve your speed
- Reduce unused JavaScript that has many heavy JS
- Many images, video are not applied the lazy loading technique
- Can consider changing the theme of your site
- Fix the problems in the console store
Therefore, you can re-check your theme to solve those problems or try speed-optimized service. for more information, you can contact us at julia@onecommerce.io or WhatsApp: +61 3 9028 6983

OneCommerce - The Ultimate eCommerce Solution Platform
We offer 12+ solutions to help increase traffic, maximize conversion rates and generate better revenue for more than 500,000 eCommerce merchants worldwide.

Get know us at: Website | Blog | FAQ | Contact us