Replace WordPress jQuery with Google-Hosted jQuery? What to Do in 2026

Should you replace WordPress jQuery with Google-hosted jQuery? In 2013 we moved jQuery from the page head to the footer and loaded it from Google’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’s bundled jQuery can break plugins. Here is what to do instead to stop jQuery slowing your site.

WordPress jQuery and Google hosted jQuery

Quick answer: For most sites, keep WordPress’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.

Why jQuery can slow WordPress

jQuery (external site) 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.

Is Google-hosted jQuery still faster?

The old argument was that visitors already had Google’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. Google Hosted Libraries (external site) still exist and are fine to use, but they are no longer a speed trick.

Better ways to stop jQuery slowing your site

  1. Defer or delay JavaScript. 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.
  2. Remove jQuery Migrate if your theme and plugins do not need it; many performance plugins have a switch for this.
  3. Use a lightweight theme. Modern themes like Kadence and GeneratePress use plain JavaScript and do not load jQuery for visitors.
  4. Audit plugins. Replace old sliders, share buttons and pop-ups that require jQuery with lighter alternatives.
  5. Load scripts only where needed with a plugin like Asset CleanUp or Perfmatters.

If you still want to load jQuery from a CDN

Only do this if you understand the risks. Deregister WordPress’s copy and register the CDN version with the same handle and a matching major version, loaded in the footer:

add_action( 'wp_enqueue_scripts', function () {
    if ( is_admin() ) return;
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery',
        'https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js',
        array(), '3.7.1', true );
    wp_enqueue_script( 'jquery' );
}, 20 );

Test every page, form and plugin afterwards. If anything breaks, remove the code. Compare CDN options in our post on the best free jQuery CDN, and see how we load Bootstrap faster.

Check the results

Run your home page and a post through Google PageSpeed Insights before and after. Look at “Eliminate render-blocking resources” and Total Blocking Time. Our Core Web Vitals guide explains the numbers.

Signs jQuery is your problem

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.

FAQ

Does WordPress still use jQuery?

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.

Is it safe to remove jQuery completely?

Only if nothing on the front end depends on it. Test with jQuery dequeued on a staging site first.

Which jQuery version does WordPress use?

WordPress ships jQuery 3.x. Keep plugins updated so they work with it.

Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Related Tech Guides

Leave a Reply

Your email address will not be published. Required fields are marked *

One Comment

  1. When you want to succeed with SEO, you should surround yourself with the fastest and the most efficient tools that you can use. This list has shown us just that. The work a person could do is only limited so if you will let these tools take care of the more technical part, then, you are good to go.