Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The error means a script ran when the global jQuery name was unavailable. It does not prove that WordPress has no jQuery anywhere on the site. The usual causes are a missing or failed enqueue, a theme or plugin conflict, or an optimization feature that changed execution order. Use the browser’s Console and Network panels to identify which script fails, then correct the dependency or loading order rather than adding a second copy of jQuery.

What the error actually means

When the browser reports Uncaught ReferenceError: jQuery is not defined, the first failing script tried to use jQuery before that global existed in its execution context. The cause may be limited to one page, one logged-in state, or one feature.

Common branches are:

  • jQuery was never enqueued on the affected page.
  • The jQuery request failed, was blocked, or returned unexpected content.
  • A theme or plugin registered dependent code incorrectly.
  • A combine, defer, delay, async, or custom script filter changed the final order.

A related message, $ is not defined, often has a different explanation: WordPress runs jQuery in noConflict mode, so the $ alias is not automatically global.

Diagnose the failing page before changing code

  1. Open the affected URL in a private or logged-out window so cached administrator assets and conditional code do not hide the problem.
  2. Open Developer Tools and select Console. Record the first ReferenceError and the script filename and line number that generated it. Later errors may only be consequences.
  3. In Network, reload the page and search for jquery. Check that the request exists, has a successful response, and is not blocked, redirected unexpectedly, or replaced by an error page.
  4. Inspect the rendered <script> tags. Compare their order with a working page, if one exists. Note whether the dependent file appears before jQuery or has an async attribute.
  5. Repeat the comparison while logged in and logged out, and with optimization temporarily bypassed. A difference identifies a conditional enqueue, cache layer, or optimizer as the likely branch.

Fix a missing or incorrectly registered dependency

Theme and plugin code should use WordPress’s script registry instead of hard-coding a second jQuery URL. Register or enqueue the dependent file on wp_enqueue_scripts and declare jquery in its dependency array. WordPress can then place the registered dependency before the dependent script.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Illustrative theme pattern

add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_script(
        'theme-custom',
        get_stylesheet_directory_uri() . '/js/custom.js',
        array( 'jquery' ),
        '1.0.0',
        true
    );
} );

Use the real file path, handle, and version for the site. The snippet is a pattern, not a guarantee that a particular theme or plugin is correct. If a plugin owns the failing file, update or repair that plugin’s registration rather than editing generated cache files.

Do not add a duplicate library as the first fix

Copying a jQuery URL from another site can create two versions, overwrite plugins’ references, or break noConflict behavior. First establish whether the registered WordPress jquery handle is present and whether its request succeeds.

Rank #2
Sale
JavaScript and jQuery: Interactive Front-End Web Development
  • JavaScript Jquery
  • Introduces core programming concepts in JavaScript and jQuery
  • Uses clear descriptions, inspiring examples, and easy-to-follow diagrams

Handle the $ is not defined variation

If Network shows jQuery loading successfully but the error mentions $, the library may be present and only the alias is unavailable. Wrap code in a function that receives jQuery:

( function( $ ) {
    // Your jQuery-dependent code
} )( jQuery );

Inside that wrapper, $ is local. This follows WordPress’s noConflict mode and avoids assuming that another library has not claimed the global alias.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check optimization and loading order

Temporarily disable JavaScript combine, defer, delay, and similar features, then retest the exact page and feature. If the error disappears, re-enable optimization and exclude the affected dependency or dependent file using that product’s controls.

async versus defer

Attribute or approach Execution behavior Risk for dependencies
async Executes as soon as downloading finishes; order among scripts is not guaranteed. A dependent file can run before jQuery.
defer Runs after parsing and preserves order among deferred scripts. Usually safer when the dependency chain is correctly declared.
WordPress enqueue dependencies The registered dependency tree informs placement and eligible loading strategy. Protects the intended relationship, provided third-party filters do not rewrite the final tags.

WordPress’s loading-strategy logic does not override every optimizer or custom script_loader_tag filter. Inspect the HTML actually delivered to the browser after changing settings. A plugin interface may label these controls differently; use its own exclusion and delay settings rather than applying WP Rocket instructions blindly to another product.

Isolate theme and plugin conflicts

  1. Back up the site or work on staging if available.
  2. Temporarily switch to a default WordPress theme and test the same URL and feature.
  3. If the error remains, disable plugins as appropriate, then test again.
  4. Restore plugins one at a time, testing after each activation. The plugin whose return coincides with the error is the leading culprit.
  5. For a theme-specific result, inspect that theme’s enqueue hooks, conditional checks, and any custom script-tag filters.

This controlled process identifies a cause; it is more reliable than assuming the last installed plugin is responsible. Restore the original theme and plugin state after each test that is not your chosen fix.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Clear caches and verify the repair

After correcting registration or optimization, clear the relevant page-cache, browser-cache, CDN, and minified-file layers. Then test in a private window while logged out.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Reload the exact URL that failed.
  • Confirm jQuery’s request succeeds and appears before the dependent file.
  • Confirm the Console no longer reports the ReferenceError.
  • Exercise the feature that originally failed, not just the homepage.
  • Check a logged-in view if the site serves different assets to administrators.

Do not leave all JavaScript optimization disabled permanently if a narrower dependency or exclusion resolves the problem.

Use the symptom to choose the next test

Observation Most useful next check
No jQuery request on the failing page Find the conditional enqueue or missing jquery dependency.
jQuery request returns an error or is blocked Fix the URL, server response, security rule, or cache layer before changing execution order.
jQuery loads, but dependent code appears first Remove the forced async behavior and repair the registered dependency or optimizer exclusion.
Only $ fails Use a noConflict-safe wrapper and keep jQuery as the argument.
Error disappears with optimization disabled Re-enable features selectively and exclude the dependency chain that breaks.
Error disappears under a default theme or with a plugin disabled Repair or replace the identified theme/plugin registration.

When to get developer help

Consider a WordPress developer or maintenance service when the failing code is bundled or generated, the site uses several cache/CDN layers, or the error returns after every update and cannot be isolated safely. Provide the developer with the failing URL, first Console error, Network response for jQuery, rendered script order, and the results of the theme/plugin and optimization tests.

Quick Recap

SaleBestseller No. 1
Web Design with HTML, CSS, JavaScript and jQuery Set
Web Design with HTML, CSS, JavaScript and jQuery Set
Brand: Wiley; Set of 2 Volumes
$35.05
SaleBestseller No. 2
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript and jQuery: Interactive Front-End Web Development
JavaScript Jquery; Introduces core programming concepts in JavaScript and jQuery; Uses clear descriptions, inspiring examples, and easy-to-follow diagrams
$22.80

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.