• Resolved Joel G Goodman

    (@asilentthing)


    I’m wondering if there’s an easy filter or action to move the Jetpack CSS to load in wp_footer. Right now, since it’s such a big file, it’s a blocking CSS file in wp_head and Google PageSpeed doesn’t like it.

    I dug a bit through the plugin, but figured someone here would know what it is off the bat.

    Thanks!

    https://www.ads-software.com/plugins/jetpack/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m not sure I’d recommend moving that file to the footer. That could cause layout issues with all Jetpack elements until the whole page gets loaded.

    It’s also worth noting that this file is usually not the biggest file to be loaded in the footer. If I look at your own site for example, your theme’s style.css is actually bigger than jetpack.css:
    https://i.wpne.ws/bl9R

    There are also other files that you could load in the footer, like .js files, that would have a bigger impact on your site’s performance.

    If you still want to enqueue the file in the footer, you can look at how jetpack.css is enqueued today, and enqueue it somewhere else instead:
    https://github.com/Automattic/jetpack/blob/3.5.3/class.jetpack.php#L574

    Thread Starter Joel G Goodman

    (@asilentthing)

    Which I get, but it still doesn’t get Google SpeedRank off my back for loading in blocking JS and CSS assets in the head. My pages are generally lightweight as far as markup and graphics go and I’m aiming for better time to first load, regardless of the layout.

    Thanks for the git link, that’ll be helpful.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    it still doesn’t get Google SpeedRank off my back for loading in blocking JS and CSS assets in the head

    I’m afraid you’ll never be able to completely get rid of all the warnings on that page. To do so, you’d have to move all your js and css files to the footer of your site, and that could deteriorate the user experience on your site for folks with a slower internet connection.

    Although the messages can be frustrating, I’d suggest viewing Google PageSpeed messages as recommendations: it’s great to apply some of them, but it’s ok if some things are left as warnings. At the end of the day, you have to make compromises to get a good Google PageSpeed score while keeping your site as user friendly as possible.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Moving Jetpack styles to wp_footer’ is closed to new replies.