Javascript code is loaded twice with the same id

Hello,

We are using Hubspot in our WordPress based site (with official HubSpot plugin for WordPress).

During optimizations regarding WCAG2.0 compliance, I have noticed that the same script is loaded twice:

<script type="text/javascript" id="hs-script-loader" async="" defer="" src="//js.hs-scripts.com/2470523.js"></script>

<script async="" defer="" id="hs-script-loader" type="text/javascript" src="//js.hs-scripts.com/2470523.js?integration=WordPress"></script>

Both elements have the same id (hs-script-loader) which is not good of course, and why twice?

@danny_briskin My guess is that you have the official HubSpot WordPress plugin installed in addition to manually adding the HubSpot script to your site in your theme somewhere. I’d try and look in your theme files for the script.

It most likely would be in functions.php, footer.php, or header.php.

If you can locate it, remove it, then just use the HubSpot plugin.

Thank you so much!

It was in parent theme footer… Someone/something put it there a long time ago maybe.