Do you still need jQuery in 2026? Moving an old site to modern JS

Most new websites do not need jQuery in 2026, because modern browsers now do natively what jQuery was created to smooth over: selecting elements, handling events, changing classes and making network requests. Existing sites, though, do not have to rip it out. If jQuery is old (anything before 3.5.0 has a known cross-site scripting fix missing), upgrade it first; then remove it gradually where it adds weight and nothing else depends on it.

Key takeaways

  • jQuery is still maintained: jQuery 4.0.0 was released on 17 January 2026, the first major version in almost ten years.
  • The jQuery team now supports only the 4.x branch fully; 3.x "will only receive critical security patches and bug fixes", and 1.x and 2.x are unsupported.
  • jQuery 4.0 removed long-deprecated helpers such as jQuery.trim and jQuery.parseJSON in favour of native JavaScript, and dropped IE 10 and older.
  • The upgrade path is official: upgrade one major version at a time and use the jQuery Migrate plugin's console warnings as a to-do list.
  • Removing jQuery is worth it when it is the only thing a page loads it for; it is not worth a rewrite of working plugins on its own.

Is jQuery still maintained in 2026?

Yes. The jQuery team released jQuery 4.0.0 on 17 January 2026. According to the release post it includes breaking changes, but most users should need only minor code changes. The project's support page says it supports only the latest version, that 3.x gets only critical security patches and bug fixes, and that the 1.x and 2.x branches are no longer supported.

What changed in 4.0, in brief:

  • Removed helpers that browsers now provide: jQuery.isArray, jQuery.parseJSON, jQuery.trim, jQuery.type and jQuery.now, replaced by Array.isArray(), JSON.parse(), String.prototype.trim() and Date.now().
  • Browser support: dropped IE 10 and older, Edge Legacy, older iOS and Firefox versions and the old Android Browser. IE 11 stays for now, with removal planned for jQuery 5.0. If you must support those older browsers, the team says to stay on 3.x.
  • Security and modern tooling: support for Trusted Types, so HTML wrapped in TrustedHTML can be passed to jQuery methods, and source moved to ES modules.
  • Size: removing deprecated APIs and old IE code cut over 3 KB gzipped, and the slim build is about 19.5 KB gzipped.
  • Focus events now follow the standard browser order rather than jQuery's own.

Why do so many old sites still use jQuery?

Because ten or fifteen years ago it was the sensible choice. Browsers disagreed on how to find elements, attach events and make Ajax calls, and jQuery hid those differences behind one short syntax. Themes, sliders, form validators, lightboxes and template libraries were built as jQuery plugins, which is why the original 2017 version of this article was about jQuery templates for turning JSON data into HTML. Many of those plugins are no longer updated, and they are often the real reason a site cannot move to a newer jQuery.

When should you keep jQuery?

Keeping it is reasonable when:

  • The site runs a CMS, theme or plugins that depend on jQuery, and replacing them would cost more than it saves.
  • The jQuery code works, is on a supported version (4.x, or at least the latest 3.x), and the page is not slow because of it.
  • The site is due for a rebuild soon anyway, so effort is better spent on the new version.

Removing it is worth planning when:

  • jQuery is loaded on every page for a handful of small tasks such as a menu toggle or a form submit.
  • The version is old (1.x, 2.x or 3.x before 3.5.0). jQuery 3.5.0, released on 10 April 2020, fixed a cross-site scripting issue in jQuery.htmlPrefilter.
  • Several jQuery versions or overlapping plugins load on the same page.
  • You are moving to a component framework (React, Vue, Angular or similar) where direct DOM changes by jQuery conflict with how the framework updates the page.

What replaces jQuery in modern JavaScript?

For the common tasks, the built-in browser APIs documented on MDN are enough:

Task jQuery Native JavaScript
Select elements $('.card') document.querySelectorAll('.card')
Select one element $('#menu') document.querySelector('#menu')
Handle a click $('#btn').on('click', fn) btn.addEventListener('click', fn)
Toggle a class $el.toggleClass('open') el.classList.toggle('open')
Run when the page is ready $(fn) <script defer> or DOMContentLoaded
Ajax request $.ajax() / $.getJSON() fetch()
Trim a string $.trim(s) s.trim()

A typical rewrite of a small jQuery snippet looks like this:

// Before (jQuery)
$('.faq-question').on('click', function () {
  $(this).next('.faq-answer').slideToggle();
});

// After (native JavaScript)
document.querySelectorAll('.faq-question').forEach((q) => {
  q.addEventListener('click', () => {
    q.nextElementSibling.classList.toggle('is-open');
  });
});

Animations such as slideToggle are usually better done with a CSS transition on a class, which keeps the JavaScript small. For anything bigger than a few interactions, a component framework or a small library chosen for that job is usually cleaner than a hand-built replacement of every plugin. We build with TypeScript and frameworks such as Next.js and Nuxt; see our TypeScript development page if you are moving that way.

How do you move an old site off jQuery safely?

Do it in stages, so the site keeps working at every step.

  1. Inventory. List every page that loads jQuery, its version, every plugin and every inline script that uses $. Note which plugins are no longer maintained.
  2. Upgrade before you remove. Follow the official jQuery upgrade guide: move one major version at a time (1.x or 2.x to the latest 3.x, then 3.x to 4.x), add the uncompressed jQuery Migrate plugin for that step, and treat each console warning as a task. Remove Migrate once the warnings are gone. Migrate 4 does not warn about behaviour removed in earlier major versions, so you cannot skip the 3.x step from very old code.
  3. Replace the easy parts. Rewrite small snippets (menus, toggles, form posts) in native JavaScript using the table above.
  4. Replace plugins one at a time. For each jQuery plugin, choose a maintained replacement or a native element (for example the HTML dialog element for simple modals), and test it on its own.
  5. Remove jQuery page by page. Once a page has no jQuery code left, stop loading the library there. Check the browser console and your analytics events after each change.
  6. Measure. Compare page weight and interaction responsiveness before and after on real devices; our article on Core Web Vitals and INP explains what to watch.

For CMS sites, check whether the theme or plugins load jQuery themselves before you remove it; taking it away can break them.

Is it worth rebuilding instead?

Sometimes. If the site's front end is a stack of old plugins, the design is dated and the content structure needs work too, a rebuild can cost less in total than a step-by-step clean-up. Our HTML and CSS development team builds modern, lightweight front ends, and our website redesign and migration service covers keeping URLs, content and search rankings intact through a rebuild. We moved our own site from WordPress to Astro in October 2026 and wrote up what we learned from that migration.

FAQ

Is jQuery dead?

No. jQuery 4.0.0 was released in January 2026 and the 4.x branch is actively supported. It is simply less necessary for new projects than it used to be.

Is it safe to keep jQuery 1.x or 2.x?

No. Those branches are unsupported and versions before 3.5.0 lack an XSS fix in jQuery.htmlPrefilter. Upgrade, or remove jQuery.

Can I upgrade straight from jQuery 1.x to 4.0?

Not in one step. The official guide routes you through the latest 1.x or 2.x, then 3.x with Migrate 3, then 4.x with Migrate 4.

Does removing jQuery make my site faster?

It removes one download and the code that runs on it, but how much that matters depends on the page. Measure before and after rather than assuming.

Does jQuery 4 still support Internet Explorer 11?

Yes, for now. The jQuery team plans to drop IE 11 in jQuery 5.0.

What about jQuery UI?

jQuery 4.0.0 requires jQuery UI 1.13.3 or newer, according to the upgrade guide.

Sources (11 links)
Share this article