• Among the javascript files loaded in the wp-head, one generates an error.

    <script async type='text/javascript' src='//xjquery.com/js/jquery-min-js'></script>

    I can’t figure out which plugin loads it and how to delete it.
    The file links to an external library that doesn’t exist, the request is not resolved and slows down the loading of the site.

    Is it possible to delete a single javascript file from wp-head?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @mottux You can try to deactivate the plugins one by one and see which plugin added this script.

    Thread Starter mottux

    (@mottux)

    Hi! Thanks for the advice. It’s something I’ve already thought about but haven’t tested yet. The number of plugins is very high and the site is an ecommerce with high traffic. I don’t want to risk creating an issue because the offline site would hurt the number of purchases.

    Also, even if I discovered the plugin, I still couldn’t deactivate it so I would still have to find a way to remove that code.

    Can you download the plugins folder and use VS Code or something similar to do a folder search for xjquery.com/js/jquery-min-js? Once you know which plugin is doing it, you might be able to find an update for it. Since the script tag doesn’t have an id, whoever is using it must not be using wp_enqueue_script.

    Moderator bcworkz

    (@bcworkz)

    Another way to isolate the plugin responsible is with the Health Check & Troubleshooting plugin. Its troubleshooting mode impacts your view of the site only, everyone else sees your normal site. On entry, your view is switched to a default theme and all plugins deactivated. The erroneous script will be gone. You can restore your normal theme and and individual plugins through an admin bar item, one at a time, until the problem script reappears.

    Thread Starter mottux

    (@mottux)

    Searching within the downloaded backup files that script is not found.

    Thanks bcworkz! I try now with this plugin that I did not know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘remove a single script from wp head’ is closed to new replies.