Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Deregister Unknown jQuery Script WordPress

  • SOLVED

Hello,

I'm using jQuery Mobile framework for building my wordpress website. I've nearly removed all unwanted scripts.

But their is just one more I need to remove - but I don't where it's coming from.

See below the contents of my wp_head

<script src='/wp-includes/js/l10n.js?ver=20101110'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js?ver=3.1.2'></script>
<script src='/wp-content/plugins/gravityforms/js/jquery.json-1.3.js?ver=1.5.2.8'></script>
<script src='/wp-content/plugins/gravityforms/js/gravityforms.js?ver=1.5.2.8'></script>
<script src='/wp-content/themes/motorcyclelive-app/scripts/fr-mobile-wp.js?ver=3.1.2'></script>
<script src='/wp-content/themes/motorcyclelive-app/jqm/jquery.mobile-1.0a4.1.js?ver=3.1.2'></script>


The one I'm desperate to remove is the jquery-min which is loading from google. See below

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js?ver=3.1.2'></script>

The only plugins that I am running are...

Gravity Forms
Clean up wp_head
Really Simple CAPTCHA

I have definitely deregistered the gravity forms jQuery by adding this in my functions...

add_action("gform_enqueue_scripts", "deregister_scripts");
function deregister_scripts(){
wp_deregister_script("jquery"); }



Any quick advice will be amazing.

Answers (3)

2011-08-13

Jens Filipsson answers:

In you theme folder, locate and open the file <em>functions.php</em> in a text editor.

There you will probably find a line similar to this:

// Load jQuery
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"), false);
wp_enqueue_script('jquery');
}


Remove it, and you will be good to go!


Josh Cranwell comments:

I'm really sorry all - I did not realize these expire so quickly - thanks Jens for your response. It was there.

2011-08-12

Gabriel Reguly answers:

Hi,

Seems to me that you are using <strong>Use Google Libraries</strong> plugin.

Are you sure that is not the case?

If you are running a multisite version of WordPress, it can be found under /wp-admin/network/plugins.php

Regards,
Gabriel


Josh Cranwell comments:



Hi Gabriel, this is the code from my plugins.php in 'network'.

/** Load WordPress Administration Bootstrap */
require_once( './admin.php' );

if ( ! is_multisite() )
wp_die( __( 'Multisite support is not enabled.' ) );

require( '../plugins.php' );


How do you mean multisite? As in wordpress MU or just running 2 themes at the same time.

I just realised I'm also using this plugin.

WPtap Mobile Detector

This is the plugin I'm redirecting mobiles to my mobile theme.

I take it I'm not using '<strong>Use Google Libraries</strong>'?


Gabriel Reguly comments:

Hi Josh,

Multisite is the modern MU :-)

Anyway, why not remove jQuery before gravity forms?

As in


<?php
function my_init_method() { wp_deregister_script( 'jquery' );}

add_action('init', 'my_init_method');
?>


It might be a solution.

2011-08-12

Julio Potier answers:

Hello,
I think this jquery-min is added by your theme. Which theme is it ?

Search in all php files of your theme for "http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"

Hope it helps