~ read.
Wordpress - jQuery Version Fix

Wordpress - jQuery Version Fix

So in my experience with WordPress over the years I have come across a lot of errors. I can usually figure them out or Google my way through any situation. Whether its writing my own code to patch fix these small errors or just copying & pasting random functions or code modifications random people on the internet suggest. There has always been one thing I could never fix.

This stupid error about "blockUI" requiring a higher version of jQuery.


blockUI requires jQuery v1.2.3 or later! You are using v1.11.3

I have found and used a lot of themes over time and sometimes they were really old and no longer under development or support. As WordPress evolves and things change, those same themes that don't evolve WITH WordPress tend to break all over. This eventually happened to me after I upgraded to the current version of WordPress and I was using such an old theme. Anything you clicked on would produce that error above. You were able to click OK and move on, everything worked fine. Though it was very annoying.

There were so many search entries I found that had options that people actually said were working. A lot of variations of the function below were offered but didn't work.

if( !is_admin()){
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"), false, '1.9.1');
wp_enqueue_script('jquery');
I also read that there were WordPress plug-ins that could fix this so I tried a few out.
                           ![](/content/images/posts/wordpress/plugin.png) ![](/content/images/posts/wordpress/plugin2.png)                           

These two were the ones that actually seemed to help and made sense. With each one separate or together I got almost every link fixed within WordPress except anything related to the login page (which I narrowed down to be wp-login.php). That's when I got fed up and had another idea. Let me see where these jQuery files are being referenced and just replace them.

I reproduced the error, loaded up the developer console, and instantly saw the block of code I needed. Right there in the source of the page loaded I found the reference to the jQuery files.

<script type='text/javascript' src='http://support.shadowsfilter.com/wp-includes/js/jquery/jquery.js?ver=1.11.3'></script>
<script type='text/javascript' src='http://support.shadowsfilter.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<script type='text/javascript' src='http://support.shadowsfilter.com/wp-content/themes/supportpress_copy/includes/js/modernizr.min.js?ver=4.4.1'></script>
<script type='text/javascript' src='http://support.shadowsfilter.com/wp-content/themes/supportpress_copy/includes/js/plugins.js?ver=4.4.1'></script>
<script type='text/javascript' src='http://support.shadowsfilter.com/wp-content/themes/supportpress_copy/includes/js/jquery.defaultvalue.js?ver=4.4.1'></script>

Followed the path "wp-includes/js/jquery/" and checked out the jquery.js file.
The first comment read:

/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */

Well this was the main source file so I figured, "I wonder if it will work if I just swap out this file with the newer version and not update anything else?" Guess what? It WORKED! hahahaha

I did some Googling and came across the jquery.js file from v1.2.3 (specifically the version my theme was crying about) on Google Code. You may need a different version for your specific error, so you will have to find some repository online or maybe Google Code for the correct file. 

Once you get that, these are the steps I took to get it fixed:

  • 1.) Deactivate those jQuery fixer plug-ins that half-way worked.
  • 2.) Rename the original jquery.js file (jquery.js.old will work)
  • 3.) Upload the new jquery.js file.
  • 4.) DON'T FORGET TO "Empty Cache and Hard Reload."
  • 5.) In Chrome, hit F12, Right-Click the Refresh button, 3rd option
  • 6.) Let it refresh.
  • 7.) BOOM! No more errors!

Everything I clicked worked just fine and the version requirement has finally been met. I know this wasn't a proper upgrade, but its a little hack just to make it work. That is all I needed!

If you have any questions please feel free to comment below.

5/9/16 Update - You will have to do this everytime WordPress upgrades jquery. I just upgraded to WordPress 4.5.2 today and it overwrote my jquery.js file to v1.12.3 and I had to follow these steps again.