Home / Disable / Disable jQuery Migrate
Duplicate Snippet

Embed Snippet on Your Site

Disable jQuery Migrate

Prevent loading the jQuery Migrate script in the frontend.

70+
Code Preview
php
<?php
add_action( 'wp_default_scripts', function ( $scripts ) {
	if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
		$script = $scripts->registered['jquery'];
		if ( ! empty( $script->deps ) ) {
			$script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
		}
	}
}, 150 );

Comments

Add a Comment