Archived topic
Preload in Hook?
1 reply · Started by donandsuji on August 28, 2021
I'm very new to this aspect of websites., please forgive me if I've completely confused things.
And thanks so much for any help you can provide.
I was testing my website speed with Google Pagespeed.
I got this recommendation: Consider using <link rel=preload> to prioritize fetching resources that are currently requested later in page load.
I may be far off base here.., but I tried to use an Element hook in the wp-head.
I'm not sure if this is correct AT ALL.
I was hoping if it was/wasn't if you wouldn't mind pointing me in the correct direction?
Much Appreciated,
Don
Hi there,
the wp_head hook is the correct place for adding preload links ( and other scripts / meta ).
But the preload must include the href for the actual files you want to preload.
If you can share a link to your site i can check to see what if any of them can be preloaded.