Solved

Where to find and remove unused JavaScript in theme code?

Gauresh
Tourist
4 0 2

Where inside the "edit theme code" should I find the folders to Reduce unused JavaScript??

 

For example, one of my errors (found from Google Coverage) is :

 

/ultimatesalesboost.js?shop=haussmanninc.myshopify.com
 
Now under the Source table, I can see the red lines which means I can remove the lines of code from the actual theme code.
 
reduce JS_CSS errors 01.jpg
 
So where exactly/ which folder should I go and remove that code based on the URL?
 
What steps should I follow to make the smooth so that other aspects of the site are not affected?
reduce JS_CSS errors 02.jpg
~
 

 

Accepted Solution (1)

flareAI
Shopify Partner
2405 223 537

This is an accepted solution.

Hello @Gauresh,

 

Greetings! I am Gina from the flareAI app helping Shopify merchants get $6Million+ in sales from Google Search, on autopilot.


For third-party app-related speed issues, it is better to check with the app support team only and ask for help.


However, to reduce unused JavaScript in your Shopify theme, you'll need to access your theme's code and locate the relevant JavaScript files.


Steps:


1. From your Shopify admin dashboard, click "Online Store" > "Themes" > "Edit Code"

2. In the left-hand panel, you'll see a list of files and folders. Look for a folder named "Assets" and click to open it.

3. Within the "Assets" folder, you should see a list of JavaScript files. Look for files that are not being used by your website and delete them. Be careful not to delete any files that are being used, as this can break your website's functionality.

4. You can also minify the remaining JavaScript files to reduce their size. To do this, you can use a JavaScript minifier. Copy the contents of each JavaScript file into the minifier and then paste the minified code back into the original file.

5. Once you have made your changes, save the files and refresh your website to ensure that everything is still working properly.


Remember to always make a backup of your theme before making any changes to the code. This will ensure that you can easily restore your website if anything goes wrong.


Hope this helps


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

View solution in original post

Replies 5 (5)

made4Uo
Shopify Partner
3821 716 1148

Hi @Gauresh 

 

It looks like a script coming from an app. Can you check if you have an app something to do with boosting sales?

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
Gauresh
Tourist
4 0 2

Hello,

 

Yes we have an app called Hextom: Ultimate Sales Boost

 

They add a sales countdown timer + payment badges to our product pages.

Also, I noticed that both of them are taking a significant amount of time to load up on the product page.

 

We recently switched our theme from supply to Dawn 2.0

Please advise!

 

reduce JS_CSS errors 03.jpg

flareAI
Shopify Partner
2405 223 537

This is an accepted solution.

Hello @Gauresh,

 

Greetings! I am Gina from the flareAI app helping Shopify merchants get $6Million+ in sales from Google Search, on autopilot.


For third-party app-related speed issues, it is better to check with the app support team only and ask for help.


However, to reduce unused JavaScript in your Shopify theme, you'll need to access your theme's code and locate the relevant JavaScript files.


Steps:


1. From your Shopify admin dashboard, click "Online Store" > "Themes" > "Edit Code"

2. In the left-hand panel, you'll see a list of files and folders. Look for a folder named "Assets" and click to open it.

3. Within the "Assets" folder, you should see a list of JavaScript files. Look for files that are not being used by your website and delete them. Be careful not to delete any files that are being used, as this can break your website's functionality.

4. You can also minify the remaining JavaScript files to reduce their size. To do this, you can use a JavaScript minifier. Copy the contents of each JavaScript file into the minifier and then paste the minified code back into the original file.

5. Once you have made your changes, save the files and refresh your website to ensure that everything is still working properly.


Remember to always make a backup of your theme before making any changes to the code. This will ensure that you can easily restore your website if anything goes wrong.


Hope this helps


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
MadFictionLabel
Visitor
1 0 0

Hi!

 

Can I ask a follow-up question? 

 

I am in the "Assets"-tab, wanting to minimize and remove unused javascript. But I am not entirely sure what is Javascript and not. Is there any tool or method for this? 

momnika
Visitor
1 0 0

I am not an expert but I think the ones ending with .js are javascript and the ones ending with .css are css.

For example cart.js or collage.css