In order to speed up loadtime I try to avoid unnecessary loads. In the Google report (and in my html) I see that many unwanted files are loaded, as jquery-migrate.min.js?ver=1.4.1, core-min, mouse-min, button-min, widget-min and more. I am certain I do not need or use them but they cause (among more) a terrible loadtime. I am using theme Twenty Seventeen.
What should I do to avoid loading these jquery-min files?
The site: www.vakantiehuisverhuur.eu.
Regards Rudolph Smits, NL
In order to speed up loadtime I try to avoid unnecessary loads. In the Google report (and in my html) I see that many unwanted files are loaded, as jquery-migrate.min.js?ver=1.4.1, core-min, mouse-min, button-min, widget-min and more. I am certain I do not need or use them but they cause (among more) a terrible loadtime. I am using theme Twenty Seventeen.
What should I do to avoid loading these jquery-min files?
The site: www.vakantiehuisverhuur.eu.
Regards Rudolph Smits, NL
I can not explain this but this seems to be solved.
Using Autoptimize already but now aggregating javascript in stead of minify did the job. I could not do this before because it made Contact Form 7 fail to redirect to a "thank you" page after sending a form. With the help of the author that has been solved so that I can "aggregate" now.
I saw people from all over the world visiting my site. Thank you for your intention to help. Moped, especially to you!
Regards Rudolph Smits, Netherlands
add the following codes to the functions.php file:
// Remove Query Strings
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
// Remove jquery migrate
function dequeue_jquery_migrate( $scripts ) {
if ( ! is_admin() && ! empty( $scripts->registered['jquery'] ) ) {
$scripts->registered['jquery']->deps = array_diff(
$scripts->registered['jquery']->deps,
[ 'jquery-migrate' ]
);
}
}
add_action( 'wp_default_scripts', 'dequeue_jquery_migrate' );
Trying to find out what "migrate" does I found this wordpress plugin: https://nl.wordpress/plugins/remove-jquery-migrate/
I think it does the same as the code of Maynor Peralta above but his code will do it more efficiently. I will try do apply that next week.
Yesterday I got a ban from Google Recaptcha v3 due to - I think - to many same test actions. I will have to wait till this is over. ;-(
Regards Rudolph Smits