Bobcares

How to fix “uncaught referenceerror jquery is not defined” WordPress ?

by | Feb 11, 2023

Let’s fix the ‘uncaught referenceerror jquery is not defined’ in WordPress. As a part of our WordPress Support Services, Bobcares offers solutions to your WordPress concerns.

Fix the ‘uncaught referenceerror jquery is not defined’ in WordPress

The “uncaught referenceerror jquery is not defined” error in WordPress may appear when a jQuery-powered website is unable to call a function from the jQuery JavaScript library, stopping one or more website elements from functioning. Some of the common reasons that lead to the error are as follows:

1. A jQuery variable from a recently installed or activated plugin can conflict with a variable from an older plugin. The jQuery problem could potentially result from the plugins not being updated.

2. A CDN-hosted jQuery that is blocked from reaching the server due to the huge number of requests.

3. The jQuery code is not included in the program when the JavaScript code loads first. As a result, it cannot be used, and the notice “not defined” will show up.

4. Downloading jQuery files from unreliable sources may also lead to this error.

Methods to fix the ‘uncaught referenceerror jquery is not defined’ in WordPress

1. Define the file path (ABSPATH) in the WordPress core file: Add the following code to the wp-config.php file. We can use a File Manager or an FTP client.

uncaught referenceerror jquery is not defined wordpress

2. Setting an alternative in case the CDN is blocked so that the server can execute the cached version of jQuery. This keeps the site functioning normally.

uncaught referenceerror jquery is not defined wordpress

3. If jQuery was already present in the website file, the problem might have been caused by the code not loading properly. The next step is to verify the WordPress page’s source code once more and search for the < script src=””> tag in the header section. Then, test a new web page by pasting the jQuery library’s URL there to see if it loads.

4. We should include the jQuery library in the header.php file using the below steps:

    • Go to the Google Hosted Libraries and download the most recent CDN code snippet for jQuery.
    • Look in the theme folder for the header.php file.
    • Include the code from the first step right below the < head > tag after opening the file.
    • Lastly, click on the Save button.

[Are you searching for an answer to a different query? We’re available 24/7.]

Conclusion

To conclude, we provide some of the causes and solutions for the error “uncaught referenceerror jquery is not defined” in WordPress.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.