{"id":39459,"date":"2013-11-25T21:52:24","date_gmt":"2013-11-25T16:22:24","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=39459"},"modified":"2026-10-07T20:28:04","modified_gmt":"2026-10-07T14:58:04","slug":"wordpress-jquery-to-google-hosted-jquery","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/","title":{"rendered":"Replace WordPress jQuery with Google-Hosted jQuery? What to Do in 2026"},"content":{"rendered":"<p>Should you replace WordPress jQuery with <strong>Google-hosted jQuery<\/strong>? In 2013 we moved jQuery from the page head to the footer and loaded it from Google&#8217;s CDN to speed up QOT, a popular trick at the time. In 2026 the advice has changed. Browsers no longer share cached files between websites, so a CDN copy has lost most of its advantage, and swapping WordPress&#8217;s bundled jQuery can break plugins. Here is what to do instead to stop jQuery slowing your site.<\/p>\n<p><img decoding=\"async\" class=\"alignright size-full wp-image-39460\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/jquery.png\" alt=\"WordPress jQuery and Google hosted jQuery\" width=\"230\" height=\"210\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/jquery.png 230w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/jquery-150x136.png 150w\" sizes=\"(max-width: 230px) 100vw, 230px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> For most sites, keep WordPress&#8217;s own jQuery. Instead, defer or delay JavaScript with your caching plugin (LiteSpeed Cache, WP Rocket), remove jQuery Migrate if nothing needs it, and choose a theme and plugins that do not need jQuery on the front end. Replace it with Google Hosted Libraries only if you control all the code and test carefully.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6af2d3a755627\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6af2d3a755627\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Why_jQuery_can_slow_WordPress\" >Why jQuery can slow WordPress<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Is_Google-hosted_jQuery_still_faster\" >Is Google-hosted jQuery still faster?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Better_ways_to_stop_jQuery_slowing_your_site\" >Better ways to stop jQuery slowing your site<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#If_you_still_want_to_load_jQuery_from_a_CDN\" >If you still want to load jQuery from a CDN<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Check_the_results\" >Check the results<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Signs_jQuery_is_your_problem\" >Signs jQuery is your problem<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Does_WordPress_still_use_jQuery\" >Does WordPress still use jQuery?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Is_it_safe_to_remove_jQuery_completely\" >Is it safe to remove jQuery completely?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/11\/wordpress-jquery-to-google-hosted-jquery\/#Which_jQuery_version_does_WordPress_use\" >Which jQuery version does WordPress use?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Why_jQuery_can_slow_WordPress\"><\/span>Why jQuery can slow WordPress<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/jquery.com\/\" target=\"_blank\" rel=\"noopener\">jQuery<\/a> is a JavaScript library that powered sliders, drop-down menus and other effects for many themes. The minified file is around 30 KB compressed, but loaded in the page head it blocks rendering until it downloads and runs. Many sites load it only because one old plugin needs it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Is_Google-hosted_jQuery_still_faster\"><\/span>Is Google-hosted jQuery still faster?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The old argument was that visitors already had Google&#8217;s copy cached from other sites. Since 2020, Chrome, Safari and Firefox partition their caches by website, so that shared cache benefit is gone. A separate CDN also adds a new connection, and your own server or CDN (Cloudflare, Hostinger CDN) can serve the file just as quickly. <a href=\"https:\/\/developers.google.com\/speed\/libraries\" target=\"_blank\" rel=\"noopener\">Google Hosted Libraries<\/a> still exist and are fine to use, but they are no longer a speed trick.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Better_ways_to_stop_jQuery_slowing_your_site\"><\/span>Better ways to stop jQuery slowing your site<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><strong>Defer or delay JavaScript.<\/strong> In LiteSpeed Cache, go to Page Optimization, JS Settings and set Load JS Deferred to Deferred or Delayed. WP Rocket and others have similar options. Exclude jQuery if something breaks.<\/li>\n<li><strong>Remove jQuery Migrate<\/strong> if your theme and plugins do not need it; many performance plugins have a switch for this.<\/li>\n<li><strong>Use a lightweight theme.<\/strong> Modern themes like Kadence and GeneratePress use plain JavaScript and do not load jQuery for visitors.<\/li>\n<li><strong>Audit plugins.<\/strong> Replace old sliders, share buttons and pop-ups that require jQuery with lighter alternatives.<\/li>\n<li><strong>Load scripts only where needed<\/strong> with a plugin like Asset CleanUp or Perfmatters.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"If_you_still_want_to_load_jQuery_from_a_CDN\"><\/span>If you still want to load jQuery from a CDN<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Only do this if you understand the risks. Deregister WordPress&#8217;s copy and register the CDN version with the same handle and a matching major version, loaded in the footer:<\/p>\n<pre><code>add_action( 'wp_enqueue_scripts', function () {\r\n    if ( is_admin() ) return;\r\n    wp_deregister_script( 'jquery' );\r\n    wp_register_script( 'jquery',\r\n        'https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.7.1\/jquery.min.js',\r\n        array(), '3.7.1', true );\r\n    wp_enqueue_script( 'jquery' );\r\n}, 20 );<\/code><\/pre>\n<p>Test every page, form and plugin afterwards. If anything breaks, remove the code. Compare CDN options in our post on the <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/02\/best-free-jquery-cdn\/\">best free jQuery CDN<\/a>, and see how we <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2015\/01\/load-bootstrap-faster\/\">load Bootstrap faster<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Check_the_results\"><\/span>Check the results<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Run your home page and a post through <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/06\/faster-sites-with-google-page-speed\/\">Google PageSpeed Insights<\/a> before and after. Look at &#8220;Eliminate render-blocking resources&#8221; and Total Blocking Time. Our <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2020\/05\/core-web-vitals\/\">Core Web Vitals<\/a> guide explains the numbers.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Signs_jQuery_is_your_problem\"><\/span>Signs jQuery is your problem<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Open your page in Chrome, press F12 and look at the Network tab filtered by JS. If jquery.min.js and jquery-migrate.min.js load in the head and many other scripts depend on them, jQuery is part of your render-blocking chain. If PageSpeed Insights lists it under unused JavaScript, most pages probably do not need it at all. Fixing the plugins that rely on it often gives a bigger win than changing where jQuery is hosted.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Does_WordPress_still_use_jQuery\"><\/span>Does WordPress still use jQuery?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. WordPress bundles jQuery, mainly for the admin area and older plugins, but the block editor and many modern themes do not need it on the front end.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_safe_to_remove_jQuery_completely\"><\/span>Is it safe to remove jQuery completely?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Only if nothing on the front end depends on it. Test with jQuery dequeued on a staging site first.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Which_jQuery_version_does_WordPress_use\"><\/span>Which jQuery version does WordPress use?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>WordPress ships jQuery 3.x. Keep plugins updated so they work with it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Should you replace WordPress jQuery with Google-hosted jQuery? In 2013 we moved jQuery from the page head to the footer&#8230;<\/p>\n","protected":false},"author":4,"featured_media":39460,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-39459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/39459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=39459"}],"version-history":[{"count":1,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/39459\/revisions"}],"predecessor-version":[{"id":63555,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/39459\/revisions\/63555"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/39460"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=39459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=39459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=39459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}