0

I recently noticed that in the of my website (goinspire.com), there are 2 occurrences of the following code:

<script>jQuery(function(){});</script>

It looks like a script with a blank jquery function.

My questions are: 1) Is this code doing anything and if not, 2) How do I find out where it's coming from, so I can get rid of it.

I hope I've included all relevant/necessary information. If not, please let me know by commenting below.

This is part of an ongoing project of cleaning up my website and trying to improve page speed.

Thanks for your help!

5
  • 1
    It's quite obviously not doing anything, in this instance at least. You will have to search the sources to figure it out most likely.
    – Rarst
    Oct 28, 2014 at 18:26
  • 1
    Yes, it's doing nothing but it must have been added by some plugin or theme function. WordPress might add some code in it when conditions are met. You will need to find the source by disabling plugin one by one and/or review theme functions.
    – Robert hue
    Oct 28, 2014 at 18:30
  • Thanks for such quick responses! Are there any hints/tips to see which plugin is causing this, or do I have to go deactivating them one at a time?
    – user3515
    Oct 28, 2014 at 18:31
  • Yes, try doing that. Deactivate plugin one at a time. and if it does not work, deactivate then all and check.
    – Robert hue
    Oct 28, 2014 at 18:58
  • Okay, I got it. I think it was some old (no longer needed) code in the theme. I got rid of it and the problem is gone. Thanks for your help!
    – user3515
    Nov 3, 2014 at 19:56

1 Answer 1

1

As per comments: this code is not doing anything.

To find the culprit, first change your theme to a standard one to see if the theme is adding it. If yes, check header.php if it is hardcoded there or else functions.php for any instances of add_action('wp_head'..., where it might be lingering.

If it's not the theme, switch on/off all plugins to see which one is adding it. If you've found the plugin, see if there's an option that might be doing this. In any case, it's not harmful, so if you trust the plugin, just leave it at that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.