How to Remove WordPress jQuery
If you want to speed up your WordPress site you should be using Google to host the common JavaScript libraries.
Remove the WordPress jQuery version and add the Google one.
Add the following lines to your functions.php (inside your template folder).
if ( !is_admin() ) {
// First jQuery
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, '1.4.2', false ); // load in footer - true
wp_enqueue_script( 'jquery' );
// Now Prototype (if you're using it)
wp_deregister_script( 'prototype' );
wp_register_script( 'prototype', 'http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js', false, '1.6.1', false ); // load in footer - true
wp_enqueue_script( 'prototype' );
// Removing more Scripts...
wp_deregister_script( 'scriptaculous-effects' );
}
// First jQuery
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, '1.4.2', false ); // load in footer - true
wp_enqueue_script( 'jquery' );
// Now Prototype (if you're using it)
wp_deregister_script( 'prototype' );
wp_register_script( 'prototype', 'http://ajax.googleapis.com/ajax/libs/prototype/1.6.1/prototype.js', false, '1.6.1', false ); // load in footer - true
wp_enqueue_script( 'prototype' );
// Removing more Scripts...
wp_deregister_script( 'scriptaculous-effects' );
}
bbPress
This code can be also used in bbPress . You just need to replace the is_admin with bb_is_admin.
Related PostsIf you liked How to Remove WordPress jQuery; the posts below might interest you too:
|




October 17, 2010
06:48
You can use
function in bbPress.
October 18, 2010
08:25
Great!
Thank you Gautam