jQuery is not defined: Possible causes and simple fix in WordPress

JavaScript for WordPress

jQuery is not defined is one of the most common JavaScript errors and it can make things stop working on your WordPress website. Here how it does look like in your browser console.

Uncaught ReferenceError: jQuery is not defined

Uncaught ReferenceError: jQuery is not defined

Common Causes:

  1. One of yours plugins’ JavaScript files are not properly loaded.
  2. Some JavaScript is running before the page is fully loaded, and as such, before jQuery is fully loaded.
  3. Your CDN-hosted jQuery might be blocked or down.

How to Fix?

Sometimes it will be too complicated to find the root of the issue, as you may not be able to find the culprit plugin, theme or the function that causes that issue. jQuery is not defined issue also could happen due to incompatibility between plugins and themes, snap! In such cases, it’ll be such a pain in the..!

Method 1

Add this line to your wp-config.php file:

jQuery is not defined

Method 2

If method 1 (which is recommended) does not work, the other way to fix this issue is by adding the jQuery library directly to your theme header.php file by following these steps:

  1. Get the latest version of jQuery Library from Google Hosted Libraries

hosted_libraries

  1. Open your theme’s header.php file
  2. Paste what you got in the first step just after the head tag.
  3. Save your file.

Conclusion:

What we discussed here is not the optimal solution for fixing jQuery is not defined issue. As we mentioned, it can be too complicated to find the exact cause of the problem, so you can consider this as a quick workaround.

GET MORE STUFF 
IN YOUR INBOX
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
Close
GET MORE STUFF
IN YOUR INBOX
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
We have created the 1st online directory for the Multilingual Themes
CLICK HERE

WE'RE SOCIAL!

Follow us on..