• My website is running a little slow at the moment. My tool suggests that I make the javascript calls asynchronous because currently the browser has to wait until they’re loaded to start loading.

    I want to go into each of the calls and add the “async” keyword but I cannot find where they are actually located.

    In header.php there is only a reference to
    <?php wp_head(); ?>

    when I go into functions.php and search for wp_head, I find this

    add_action( 'wp_head', 'device_detect' );

    If I go to general_template in the wp-includes folder and look for wp_head, I only get this

    function wp_head() {
    	/**
    	 * Print scripts or data in the head tag on the front end.
    	 *
    	 * @since 1.5.0
    	 */
    	do_action( 'wp_head' );
    }

    Colud someone throw me a bone?

    The cliffs notes is, i have things like this <script type='text/javascript' src="https://website.org/wp-includes/js/jquery/jquery.js?f6986d"></script>

    in my <head></head> of my wordpress that I want to change to async, so that my page loads a little faster.

Viewing 1 replies (of 1 total)
  • Is the name of your tool the Google PageSpeed Insights?

    If so, this plugin executes the recommendations from that tool for asynchronous calls for the CSS and JS files.

    It places the JS files at the bottom of the body tag and your CSS above the body tag.

    Cheers,
    rs

Viewing 1 replies (of 1 total)
  • The topic ‘How to edit the javascript calls’ is closed to new replies.