Title: Pagespeed – Avoid serving legacy JavaScript to modern browsers / using wp_hook
Last modified: June 8, 2021

---

# Pagespeed – Avoid serving legacy JavaScript to modern browsers / using wp_hook

 *  [OptArt](https://wordpress.org/support/users/optart/)
 * (@optart)
 * [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/)
 * [@jdembowski](https://wordpress.org/support/users/jdembowski/)
    I don’t get why
   you want to split very same issue to two topics but let’s write it again.
 * [@wpdreams](https://wordpress.org/support/users/wpdreams/)
    As a person mentioned
   on [https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers/#post-14532709](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers/#post-14532709)
 * since few version you are loading “wp-hooks”
    it adds lot of other stuff (wp-
   polyfill-js-before, wp-polyfill-js-after, document.writes) it is not good for
   pagespeed rank/site speed
 * you/sby from support suggested to dequeue wp-hooks.
    sure it helps with removing
   this js but your plugin stops working then
 * please check/fix, thank you.
    -  This topic was modified 5 years ago by [OptArt](https://wordpress.org/support/users/optart/).
    -  This topic was modified 5 years ago by [OptArt](https://wordpress.org/support/users/optart/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/#post-14532751)
 * Sorry, it is not me, the it is the mods. I can not close and change topics.
 * As in my previous reply, it seems to be a core WP issue, or maybe it is intended
   for some reason. I don’t know why, the polyfill should not be loaded on modern
   browsers in my opinion.
 * For now please use the `wp_dequeue_script('wp_hooks')`
 * I will add a short-circuit to prevent that from loading up in the next release
   by default.
 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/#post-14532760)
 * Oh okay, could not read the previous reply on the other topic thath te dequeue
   didn’t help. I will remove it as soon as I can.
 *  Thread Starter [OptArt](https://wordpress.org/support/users/optart/)
 * (@optart)
 * [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/#post-14532770)
 * Thanks!
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/#post-14538502)
 * [@optart](https://wordpress.org/support/users/optart/) Did you read the link?
   You did right? This link.
 * [https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too](https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Pagespeed – Avoid serving legacy JavaScript to modern browsers / using
wp_hook’ is closed to new replies.

 * ![](https://ps.w.org/ajax-search-lite/assets/icon-256x256.png?rev=3192672)
 * [Ajax Search Lite - Live Search & Filter](https://wordpress.org/plugins/ajax-search-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-search-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-search-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-search-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-search-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-search-lite/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/pagespeed-avoid-serving-legacy-javascript-to-modern-browsers-using-wp_hook/#post-14538502)
 * Status: not resolved