Let’s cut the crap: jQuery is a JavaScript library that’s been around since 2006, and WordPress has been shipping it by default for ages. In 2026, plenty of people ask if it’s still relevant or just dead weight. Here’s the real deal.
What exactly is jQuery and why does WordPress love it?
jQuery is a fast, small, and feature-rich JavaScript library. It simplifies HTML document traversal, event handling, and animation. In plain English: it lets you do more with less code.
WordPress uses jQuery to power a lot of its admin dashboard and many front-end features. Think of the media uploader, the customizer, and countless plugins that rely on it. If you’ve ever clicked a button in the WordPress admin and something happened without a page reload, chances are jQuery was involved.
Why did WordPress choose jQuery? Because it handles cross-browser quirks for you. In the old days, that was a lifesaver. Even now, it’s still bundled with WordPress core, so you don’t have to add it manually.
How to properly add jQuery to your WordPress theme or plugin
The wrong way is to hardcode a <script> tag in your header. That’s how you break things. The right way is to use wp_enqueue_script().
Here’s a snippet you can drop into your plugin or theme’s functions.php:
function my_plugin_scripts() {
wp_enqueue_script( ‘jquery’ );
}
add_action( ‘wp_enqueue_scripts’, ‘my_plugin_scripts’ );
That’s it. WordPress already registers jQuery, so you just enqueue it. The same goes for themes. Just make sure you’re not loading it twice or loading a different version from a CDN. That’s a recipe for conflicts.
Pro tip: use the $in_footer parameter to load scripts at the end of the document. It speeds up page rendering and avoids blocking the DOM.
Real-world uses of jQuery in WordPress (with examples)
You don’t need to be a JavaScript wizard to get value out of jQuery. Here are three things it still does well in WordPress.
1. Form validation that doesn’t suck
Nobody likes filling out a form and then getting yelled at for missing a field. jQuery lets you validate inputs on the fly. You can use a plugin like jQuery Validation or write your own. Either way, it’s smoother than waiting for a server roundtrip.
2. Smooth animations and transitions
Want a fade-in effect when a user scrolls? Or a slick toggle for a FAQ section? jQuery’s fadeIn(), slideToggle(), and animate() methods are still dead simple. Yes, CSS can do a lot of this now, but jQuery is often quicker to implement.
3. AJAX without the headache
AJAX lets you update parts of a page without reloading. In WordPress, you can use jQuery to load more posts on scroll or filter content by category. The $.ajax() function is straightforward, and WordPress provides admin-ajax.php for handling requests.
Here’s a basic example of loading more posts:
jQuery(document).ready(function($) {
$(‘#load-more’).click(function() {
$.ajax({
url: ajaxurl,
type: ‘POST’,
data: { action: ‘load_more_posts’, page: currentPage },
success: function(response) {
$(‘#post-container’).append(response);
currentPage++;
}
});
});
});
That’s the kind of stuff that used to require a full page reload. Now it’s instant.
The ugly truth: disadvantages of jQuery in WordPress
jQuery isn’t perfect. In 2026, it’s showing its age. Here’s what you need to watch out for.
Performance bloat
jQuery is an extra ~30KB (minified and gzipped) that your users have to download. If you’re only using it for a simple fade effect, that’s overkill. Modern vanilla JavaScript can do the same with a few lines and zero dependencies.
Plus, if you’re loading multiple jQuery versions because of poorly coded plugins, you’re adding even more weight. That kills your Core Web Vitals and Google will penalize you.
Conflicts and compatibility nightmares
Two plugins loading different versions of jQuery is a classic WordPress problem. You get errors like «$ is not a function» or «jQuery is not defined». The fix? Always use WordPress’s built-in jQuery and enqueue it properly. Never deregister core jQuery unless you know exactly what you’re doing.
Also, the $ shortcut can conflict with other libraries like Prototype or MooTools. Wrap your code in jQuery(document).ready(function($) { … }); to be safe.
Should you still use jQuery in 2026?
Here’s my take: if you’re building a simple site with a few interactive elements, jQuery is fine. It’s familiar, well-documented, and gets the job done. But if you’re building something modern, consider vanilla JavaScript or a lightweight library like Alpine.js or htmx. They’re smaller and often faster.
That said, WordPress core still uses jQuery, and many popular plugins like WooCommerce depend on it. So you can’t just rip it out of an existing site without testing everything. The pragmatic approach: use it where it makes sense, but don’t add it just because you can.
And if you’re a developer, learn modern JavaScript. jQuery wo