Remove scripts from homepage

DeltaAJM
Tourist
6 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:

DeltaAJM_0-1636052174990.png

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

Replies 2 (2)
oscprofessional
Shopify Partner
9459 1582 1974

@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. https://www.oscprofessionals.com/shopify-performance-optimization/

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

Please Like and Accept Solution. Free website audit to grow your business Chat on WhatsApp
| Hire us
| Expert Site Speed Optimization | Performance Site Audit | Shopify Private App | Custom Theme Development & Modifications any Shopify Theme | Shopify SEO | Digital Marketing
For Quick Chat | Email: pallavi@oscprofessionals.com | Skype : oscprofessionals-87
Zworthkey
Shopify Partner
3543 416 807

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.

Thanks

If helpful, please Like and Accept Solution.
if you Want to modify or Customize your theme ,
Hire us | Whatsapp. & Want to know more .Email us: sales@zworthkey.com

PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Designing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing