wordpress jquery from google cdn

Adding jQuery from Google CDN

To add WordPress jQuery from Google Server in your website add this below code in functions.php file:

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js", false, null, TRUE);


Simply copy and paste this below code in your theme footer.php file before the html body tag:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

To check all available libraries hosted by Google visit this below link


Important: Never deregister WordPress jQuery completely from your website. You should add WordPress jQuery from google server if it is not wordpress admin section.

Published by

Emdad Khan

I am Emdad Khan, A WordPress Theme Developer and Author of BN Web Design Website. A full time Freelancer on WordPress Theme Development & Optimization as well as blogger.

Leave a Reply