Delete script from header

Hi,

How do I delete/edit a script in the header? I am using a Cookie plugin and I want to delete the standard Facebook script so that it only adds a Facebook script when my visitors enable 3rd party Cookies.

I’ve asked the builder of the plugin the same question and he gave me this reply:

Hi @vinkdtp,

Thanks for using our plugins.

You have to add the script to the Head or Body or Footer sections to enable the 3rd party or advanced cookies, otherwise the plugin can’t block them. Our plugin injects the script added to the settings based on the user preferences. If you have no scripts, the plugin doesn’t block the scripts.

You have Facebook scripts added by other plugin or by your theme, these should be removed and the scripts should be added to the 3rd party relevant script sections.

Read more about the FAQ section.

I hope this helps.

When I click on the header.php the only thing I see is:

<?php

// =============================================================================
// HEADER.PHP
// -----------------------------------------------------------------------------
// The site header.
// =============================================================================

x_get_view( 'header', 'base' );

Best regards,

Jeroen Vink

Hi Jeroen,

Our X/Pro doesn’t add any Facebook scripts to the header. It could be from the 3rd party plugins.

Please try testing a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If it doesn’t help, please provide us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:

  • Link login to your site
  • WordPress Admin username / password

Thanks.

Hi,

I can try this but where do I find the code that is used by these plugins so I can add it to my Cookie plugin script?

Hey Jeroen,

There are 2 methods themes and plugins load scripts:

  1. Hard coding. This is not recommended in WordPress development but if a third party plugin uses this method, you should contact the plugin developer. We regretfully could not help checking third party plugins as that is not a part of our support service. I hope you’ll understand our position on this.
  2. Enqueuing Scripts and Styles. This is the recommended method and the one our products use and I believe is the one referred to by the plugin support.

But, please confirm that with the plugin developer.

I’d recommend that you first copy your site to a staging server then deactivate our products and see if the FB script is still loaded. You can then deactivate plugins one by one to see which one is loading the FB script. Now that you have an idea what plugin that is, you can contact the plugin developer.

Please also test deactivating all third party plugins and only activate X or Pro parent theme and our bundled plugins. This way, we’ll know if the FB script is loaded by one of our products. Only then can we provide further investigation.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.