V
V
Valery Stolyarchuk2016-05-20 17:13:59
Google
Valery Stolyarchuk, 2016-05-20 17:13:59

How to remove js and css code from the top of the site?

Hello!
The task is to optimize the site for a score above 80 in the google speed test.
-----------------
Link to the test
-----------------
Used the code in function.php moved all scripts to the footer

function footer_enqueue_scripts(){
    remove_action('wp_head','wp_print_scripts');
    remove_action('wp_head','wp_print_head_scripts',9);
    remove_action('wp_head','wp_enqueue_scripts',1);
    add_action('wp_footer','wp_print_scripts',5);
    add_action('wp_footer','wp_enqueue_scripts',5);
    add_action('wp_footer','wp_print_head_scripts',5);
}
add_action('after_setup_theme','footer_enqueue_scripts');

--------------------
When I perform a site test, I see on the mobile version of the site
Remove from the top of the page render-blocking JavaScript and CSS code
while the PC version does not have this note.
Tell me how to solve this issue?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Muz_Toxa, 2016-05-20
@Muz_Toxa

You have there, as I understand it, plugins slip their scripts (Google ANALYTICS and some imoji)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question