How can I effectively remove scripts from my homepage?

7 0 1

Hi everyone.

I'm trying to remove some scripts that I don't need to load on some pages using the {{content_for header}} 

But I have used the code that I saw in another forum and it does not work for me.

The code is this:


I would appreciate your help indicating that it may be failing.

Replies 2 (2)

Shopify Partner
15905 2378 3087

@DeltaAJM ,

Welcome to the Community.

Surely, we will help achieve your task easily and more cost-effectively if you are looking for a Remove scripts from homepage. we need to check liquid files and code in your store 

you can check our store.

You can directly get connected with me via email or Skype.

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free

Shopify Partner
5581 642 1574

Could you please clear me that you just wanted to show your code for limited page like index, article, collection and blog? right? 

In that case you can simply go with following liquid code in your theme:

{% if template == 'index' %}
  put your logic here
{% endif %}

Still not working you can discuss here we will surely rectify if any issue yet.