最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - How can i unload effect.min.js file?

programmeradmin0浏览0评论

I'm currently working on optimizing the speed of my WordPress site, and i successfully unloaded some unnecessary files, but there is one i can't seem to remove which is:

.min.js?ver=1.11.4

Is there a way to prevent this file from loading by adding a php code inside functions.php?

Any help would be much appreciated.

Thank you

I'm currently working on optimizing the speed of my WordPress site, and i successfully unloaded some unnecessary files, but there is one i can't seem to remove which is:

https://domain/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.4

Is there a way to prevent this file from loading by adding a php code inside functions.php?

Any help would be much appreciated.

Thank you

Share Improve this question asked Jun 10, 2020 at 19:11 marouane91marouane91 176 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

If you want to remove Effect Core the you have to remove depended scripts too. Follow this to remove them:

add_action( 'wp_enqueue_scripts', 'remove_jquery_effects', 100 );
function remove_jquery_effects()
{
    wp_dequeue_script( 'jquery-effects-core' );
    wp_dequeue_script( 'jquery-effects-blind' );
    wp_dequeue_script( 'jquery-effects-bounce' );
    wp_dequeue_script( 'jquery-effects-clip' );
    wp_dequeue_script( 'jquery-effects-drop' );
    wp_dequeue_script( 'jquery-effects-explode' );
    wp_dequeue_script( 'jquery-effects-fade' );
    wp_dequeue_script( 'jquery-effects-fold' );
    wp_dequeue_script( 'jquery-effects-highlight' );
    wp_dequeue_script( 'jquery-effects-pulsate' );
    wp_dequeue_script( 'jquery-effects-scale' );
    wp_dequeue_script( 'jquery-effects-shake' );
    wp_dequeue_script( 'jquery-effects-slide' );
    wp_dequeue_script( 'jquery-effects-transfer' );
}

Add this to your functions.php file. It's remove the script from front end.

发布评论

评论列表(0)

  1. 暂无评论