WordPress 5.6 has been released with dozens of new features and improvements. Code named Simone (honoured singer Nina Simone), WordPress 5.6 was met with a positive response, possibly because it didn’t break anything, for updated themes, but for orlder themes and plugins that use jquery migrate 1.4.1 or older now the entirely sites are down.

The first step in the WordPress modernization process was to remove jQuery Migrate 1.x from WordPress 5.5. And that’s what makes some of the sites break.

With the new update to WordPress 5.6, the included version of jQuery Migrate is also upgraded to 3.3.2 so this means that old code that previously caused warnings now may instead may cause errors or stop working entirely.

Some WordPress themes and plugins use older jQuery scripts, which cause a number of problems.

If you find issues with the way your site looks (e.g. a slider doesn’t work, javascript animation doesn’t work, a button is stuck — that sort of thing), you have a problem with jQuery Migrate.

First and the easiest method is to install jQuery Migrate Helper plugin.

The plugin was installed over 200,000 times in order to stop the “unexpected behaviors” of WordPress 5.6.

The second method to fix jQuery Migrate Issue is to add the following snippet in your functions.php file located in WordPress theme folder.

// Replace Core Jquery version
function replace_core_jquery_version() {

    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', '//code.jquery.com/jquery-1.12.4.min.js', false, '1.12.4', true );
    wp_enqueue_script( 'jquery' );

    wp_deregister_script( 'jquery-migrate' );
    wp_register_script( 'jquery-migrate', '//code.jquery.com/jquery-migrate-1.4.1.min.js', array( 'jquery' ), '1.4.1', true );
    wp_enqueue_script( 'jquery-migrate' );

}

// Hook into the 'wp_enqueue_scripts' action
add_action( 'wp_enqueue_scripts', 'replace_core_jquery_version' );

You can host the jquery files on your host and replace “//code.jquery.com/jquery-1.12.4.min.js” and “//code.jquery.com/jquery-migrate-1.4.1.min.js” with your files path.

 

Leave a Comment

You must be logged in to post a Review.