Adzbyte
All Articles
DevelopmentWordPress

Why I Stopped Using jQuery in WordPress

Adrian Saycon
Adrian Saycon
January 14, 20261 min read
Why I Stopped Using jQuery in WordPress

For years, jQuery was the default for any interactive WordPress feature. Accordions, AJAX calls, DOM manipulation — jQuery handled it all. But after dropping it from my last three projects, I am not going back.

What jQuery Solved (That We No Longer Need)

jQuery was essential when browsers were inconsistent. Cross-browser DOM traversal, event handling, and AJAX were painful without it. But modern browsers have standardized these APIs:

// jQuery
$.ajax({ url: "/api/data", success: function(data) { ... } });
$(".menu-toggle").on("click", function() { ... });
$(".cards").find(".active").removeClass("active");

// Modern JavaScript
const data = await fetch("/api/data").then(r => r.json());
document.querySelector(".menu-toggle").addEventListener("click", () => { ... });
document.querySelector(".cards .active")?.classList.remove("active");

The Performance Impact

jQuery is 87KB minified. On a WordPress site already loading Gutenberg styles, theme CSS, and plugin scripts, that extra weight adds up. More importantly, WordPress loads jQuery in the head by default, which blocks rendering. Removing it improved my First Contentful Paint by 200-400ms on every project.

Handling WordPress Dependencies

The tricky part is that some WordPress admin features and plugins depend on jQuery. I only dequeue it on the frontend:

add_action("wp_enqueue_scripts", function () {
    if (!is_admin()) {
        wp_deregister_script("jquery");
    }
});

For existing plugins that need jQuery, I evaluate whether the plugin itself is worth keeping. Often the jQuery-dependent plugin can be replaced with a few lines of vanilla JavaScript.

The Takeaway

If you are building a new WordPress theme or headless frontend, there is no reason to include jQuery. Modern JavaScript APIs cover everything jQuery did, with better performance and no dependency overhead.

Adrian Saycon

Written by

Adrian Saycon

A developer with a passion for emerging technologies, Adrian Saycon focuses on transforming the latest tech trends into great, functional products.

Discussion (0)

Sign in to join the discussion

No comments yet. Be the first to share your thoughts.