Remove jQuery migrate from WordPress site open

Remove jQuery migrate from WordPress site

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators
Tested: PHP 7

jquery-migrate.min.js to keep support for older theme and plugin developments. It was originally created as an alternative or replacement for the jQuery library from any other services in order to limit the loading of external scripts.

The script is useful in older developments up to version 1.9 of the library. Now there is practically no need to use this file.

Add this code to function.php file

function remove_jquery_migrate( &$scripts ) {
if( !is_admin() ) {
$scripts->remove( ‘jquery’ );
$scripts->add( ‘jquery’, false, array( ‘jquery-core’ ) );
}
}
add_filter( ‘wp_default_scripts’, ‘remove_jquery_migrate’ );

0

More

Leave a Reply

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

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation