From where come that JS files in ?

i have a site:, http://liebeundsprueche.com/
I see some js files in source: view-source:http://liebeundsprueche.com/
I have no idea from where these files come:

<link rel="stylesheet" id='dashicons-css'  <href="http://liebeundsprueche.com/wp-includes/css/dashicons.min.css?ver=4.9.1" type="text/css" media="all" />
<link rel="stylesheet" id='admin-bar-css'  href="http://liebeundsprueche.com/wp-includes/css/admin-bar.min.css?ver=4.9.1" type="text/css" media="all" />
<link rel="stylesheet" id='yoast-seo-adminbar-css'  href="http://liebeundsprueche.com/wp-content/plugins/wordpress-seo/css/dist/adminbar-591.min.css?ver=5.9.1" type="text/css" media="all" />
<link rel="stylesheet" id='style-css'  href="http://liebeundsprueche.com/wp-content/themes/tema/style.css?ver=20130606" type="text/css" media="all" />
<script type="text/javascript" src="http://liebeundsprueche.com/wp-includes/js/jquery/jquery.js?ver=1.12.4"></script>
<script type="text/javascript" src="http://liebeundsprueche.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1"></script>
<script type="text/javascript" src="http://liebeundsprueche.com/wp-content/themes/tema/js/small-menu.js?ver=4.9.1"></script>
<link rel="https://api.w.org/" href="http://liebeundsprueche.com/wp-json/" />

I want to collect al js files and compress in one js files, what can be easy for browser and search engines to read them. It would bbe best practise but have no idea where can i find them..
I checked and wp theme doesn’t do this. It is from WordPress itself, maybe from wp-include but don’t know exactly

1 Answer
1

Quick but not recommended solution – remove wp_head() function from your header.php file. NOT RECOMMENDED, because new plugins may not work once you did this.

The best way is to find that files in you theme code, just perform a search within your theme files for wp_enqueue_script – you have to find the hook where this files are connected and you can remove this files just by removing/commenting the appropriate line of code. This method is better but it is still not a perfect way in case it is not your custom theme.

The best way if you are using not your own custom theme is to disconnect those files with wp_dequeue_script() and wp_deregister_script() function. But you have to read these function docs to learn how to do it.

https://codex.wordpress.org/Function_Reference/wp_dequeue_script
https://codex.wordpress.org/Function_Reference/wp_deregister_script

Leave a Comment