Why jQuery Still Ships with WordPress
jQuery is a JavaScript library that simplifies DOM manipulation, event handling, and AJAX requests. It was essential in the mid-2000s when browser APIs were inconsistent, but modern browsers now provide native equivalents for nearly everything jQuery does. Despite this, jQuery remains bundled with WordPress core, and many plugins and themes still depend on it.
The library adds roughly 90 KB (30 KB compressed) to every page that loads it. WordPress also ships jQuery Migrate, a compatibility layer that adds another 27 KB (10 KB compressed) to help older jQuery code work with newer versions. Together, these two files represent a baseline JavaScript cost that many sites pay on every page load.
Why It Persists
jQuery’s persistence in WordPress is a dependency problem, not a technical one. WordPress core itself has been reducing its reliance on jQuery, but the plugin ecosystem has not followed as quickly:
- Plugin dependencies — Plugins declare jQuery as a dependency when they enqueue their scripts. If any active plugin depends on jQuery, WordPress loads it. Even a single plugin can force jQuery onto every page.
- Theme scripts — Many themes use jQuery for mobile menus, sliders, smooth scrolling, and other interactive features. Older themes are especially likely to depend on it.
- WordPress admin — The WordPress admin area still uses jQuery extensively. Plugins that load admin functionality on the front end may pull jQuery in as a side effect.
- jQuery UI — Some plugins use jQuery UI components (datepickers, sortable lists, tabs), which depend on jQuery and add even more JavaScript weight.
The Performance Impact
jQuery’s performance impact goes beyond its file size:
- Render-blocking by default — WordPress loads jQuery in the
<head>withoutdeferorasync, making it render-blocking. The browser pauses rendering to download and execute jQuery before continuing. - Execution cost — jQuery must parse and initialize before any dependent code can run. On mobile devices, this initialization takes 30-80ms — time the main thread cannot spend on other work.
- Dependency chain — jQuery loads first, then jQuery Migrate, then the scripts that depend on them. This sequential chain delays when those scripts can begin executing.
For a site that genuinely uses jQuery on every page, the cost may be acceptable. The problem is sites that load jQuery on pages where nothing uses it — the contact page loads jQuery because a slider plugin declared it as a global dependency, even though the slider only appears on the homepage.
Can You Remove jQuery?
Dequeuing jQuery is technically simple but practically risky. If any active plugin or theme requires jQuery and you remove it, that code will silently break — broken forms, non-functional menus, JavaScript errors in the console.
The safer approach is reducing where jQuery loads rather than removing it entirely. Asset management tools can disable jQuery on pages where no dependent scripts are active. Some caching and optimization plugins also offer a “defer jQuery” option that moves it out of the render-blocking path.
The long-term solution is choosing plugins and themes that do not depend on jQuery. When evaluating new plugins, checking whether they require jQuery is a worthwhile performance consideration.
Further Reading
- WordPress Performance Optimization: JavaScript (WordPress.org) — Official WordPress documentation on JavaScript optimization, including guidance on script dependencies.
