WordPress 'jQuery is not defined' Error: Fix (2026)
Quick answer
'jQuery is not defined' happens when a script that depends on jQuery loads before jQuery itself. On WordPress this is almost always caused by (1) an optimization plugin deferring or async-loading jQuery, (2) a theme dequeuing jQuery to save bytes, or (3) a hard-coded `$(...)` call outside a jQuery no-conflict wrapper. Exclude jQuery from defer/async and wrap your code in `jQuery(function($){ ... });`.
Diagnose in 60 seconds
Open Chrome DevTools → Console → reproduce the error. Console shows the file and line that failed. View source and search for `jquery` — verify it loads BEFORE the failing script.
Fix #1 — Stop deferring jQuery
In WP Rocket: File Optimization → Load JavaScript deferred → click 'Excluded JavaScript files' → add `/wp-includes/js/jquery/jquery.min.js`. Same idea in Autoptimize, Perfmatters, and SG Optimizer.
Prefer we just fix it?
This exact error is what our flat-fee website repair service resolves — most fixes ship in under 60 minutes, no retainer, no lock-in. Learn more about flat-fee website repair or grab a slot below.
Fix #2 — Stop dequeuing jQuery
Some 'speed' themes dequeue jQuery to save 30 KB. Check theme options and functions.php for `wp_dequeue_script('jquery')` — remove it if any plugin on the site depends on jQuery (most do).
Fix #3 — Use no-conflict mode in your JS
WordPress runs jQuery in no-conflict mode by default — `$` is not global. Wrap your code: `jQuery(function($){ /* your code using $ */ });`. Never write raw `$(document).ready(...)` in a WordPress theme.
When to call for help
jQuery breakage cascades — sliders die, forms stop submitting, popups misfire. Our fixed-fee JS conflict audit is $99 and pinpoints the exact optimization rule to change.
Common questions
Why does my WordPress site say 'jQuery is not defined'?+
A script tried to use jQuery before jQuery finished loading. On WordPress this is almost always caused by an optimization plugin (WP Rocket, Autoptimize, Perfmatters) deferring jQuery. Exclude /wp-includes/js/jquery/jquery.min.js from defer/async.
How do I fix jQuery errors after installing WP Rocket?+
In WP Rocket → File Optimization → Load JavaScript Deferred, click 'Excluded JavaScript Files' and add `/wp-includes/js/jquery/jquery.min.js` and `/wp-includes/js/jquery/jquery-migrate.min.js`. Purge cache and re-test.
Can I use $ in WordPress jQuery?+
Not directly — WordPress runs jQuery in no-conflict mode, so `$` is not a global. Wrap your code: `jQuery(function($){ /* $(".selector") works here */ });`. Or explicitly assign: `var $ = jQuery.noConflict();`.
Should I remove jQuery from WordPress?+
Only if you're 100% sure no plugin or theme depends on it — which is rare. Most sliders, contact forms, popups, and page builders still require jQuery. Removing it breaks them silently. Keep jQuery loaded and let it cache.
Want this handled for you?
Book a call and we will review your site before recommending anything.