• Hi

    When testing the performance of my site with http://developers.google.com/speed/pagespeed/insights/ I get a strong recomomdation to “Eliminate external render-blocking Javascript and CSS in above-the-fold content”.

    How can I achieve this with wordpress without using plugins? If there is no other way than using a plugin, which one is the best (or most standard) one?

    Thanks
    Alekv

Viewing 15 replies - 1 through 15 (of 22 total)
  • Please link to site for such help.

    Hi,

    I am getting the same errors. I am using W3 Total Cache plugin to speed up my site but I don’t know how to: Eliminate external render-blocking Javascript and CSS in above-the-fold content.

    It says: Your page has 16 blocking script resources and 1 blocking CSS resources.

    Anyone know how to fix this using this W3 Total Cache plugin. I have tried everything in the minify settings but it breaks my javascript.

    http://www.telltalesonline.com

    Typically this means move the js to the footer.

    https://developers.google.com/speed/docs/insights/BlockingJS

    Thanks Seocoast.

    I have a decent level of experience in html and css, but attempting to move all the javascript from all these plugins into the footer sounds tricky. I will give it a shot, I am just wondering if I will have to hunt this java after every plugin update!?

    Regards,

    Chris

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Hi Andrew,

    I tried the plugin, it didn’t correct any of the errors I have in Google PageSpeed Insights. It broke my category pages as well!

    Hi Seocoast,

    So I use the defer method and simply copy this into my footer?

    <script type=”text/javascript”>

    // Add a script element as a child of the body
    function downloadJSAtOnload() {
    var element = document.createElement(“script”);
    element.src = “deferredfunctions.js”;
    document.body.appendChild(element);
    }

    // Check for browser support of event handling capability
    if (window.addEventListener)
    window.addEventListener(“load”, downloadJSAtOnload, false);
    else if (window.attachEvent)
    window.attachEvent(“onload”, downloadJSAtOnload);
    else window.onload = downloadJSAtOnload;

    </script>

    Where did you get that code from?

    Also please put code in ticks – the forum cannot show all code when not in ticks.

    http://codex.wordpress.org/Forum_Welcome#Posting_Code

    Thread Starter alekv

    (@alekv)

    Using the http://wordpress.org/plugins/footer-javascript/ plugin only solved the problem for me partially.

    I’ve tried the PageSpeed Service (beta). https://developers.google.com/speed/pagespeed/service Ironically even this service doesn’t completely solve all reported issues. Anyway, it’s an interesting service and worth having a look into it. Basically it speeds up every webpage by putting a Google PageSpeed server between your webpage and the Internet. It caches and rewrites the page on the fly to make it faster. Simulated tests speed up the webpages significantly. I am currently using it and it is ok (there was not much room for improvement left on my page anyway). The setup is also not too complicated, but requires a little bit of technical know how (changes to the DNS entry). So far the service is for free, but Google plans to change it to a paid service sometime in the future. I wonder if there are any comparisons between PageSpeed Service and WordPress caching plugins. Anyone?

    Hi everybody. I am pretty new around here so easy on me guys. I just started to use the pss service and it is simply amazing. I have to say it speed up my website quite fast and also improved my score on the google page speed service test. Ranging at 90/100 currently. I am struggling with the same problem of “render-blocking Javascript and CSS in above-the-fold content” If someone would be kind enough to break it down step by step, or a link to some article that discusses the issue it would be greatly appreciated. Thanks folks. Cheers. one love.

    http://www.unitedstatesafrica.net/

    maumau254, I ran your site through the PageSpeed test and it came up with a 59 for mobile and and 67 for desktop. Did anything change or are you still seeing numbers around 90?

    Hi,
    I am receiving this below message from Google Page Speed analysis. I am using W3 Total Cache plugin. What changes I need to do in fixing it? Is it plugin issue or hosting issue?

    Eliminate render-blocking JavaScript and CSS in above-the-fold content
    Your page has 5 blocking script resources and 2 blocking CSS resources. This causes a delay in rendering your page.

    None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources, or inline the critical portions of those resources directly in the HTML.

    Remove render-blocking JavaScript:

    http://basunivesh.com/wp-includes/js/jquery/jquery.js?ver=1.10.2
    http://basunivesh.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
    http://basunivesh.com/wp-content/plugins/adsense-click-fraud-monitoring/js/checkclicks.js?ver=3.6
    http://basunivesh.com/wp-content/plugins/adsense-click-fraud-monitoring/js/updateclicks.js?ver=3.6
    http://basunivesh.com/wp-content/plugins/adsense-click-fraud-monitoring/js/check_min.js?ver=3.6
    Optimize CSS Delivery of the following:

    http://basunivesh.com/wp-content/cache/minify/000000/M9BPzUktS80zMdAtKMrXLy6pzEnVMdTPSi0pSEzO1s_NTynNSS3WL89MSU8tgdMA.css
    http://fonts.googleapis.com/css?

    Hi
    Likewise on my site. Google analytics coming up with Remove render-blocking JavaScript; and Optimize CSS Delivery.

    I have W3 installed and have unchecked the box about “removing caching of objects after settings change”

    and have also put the following code into functions.php

    ‘function _remove_script_version( $src ){
    $parts = explode( ‘?ver’, $src );
    return $parts[0];
    }
    add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 );
    add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 );’

    no change

    http://www.rchittenden.co.uk

    I have tried page speed service. After playing with various settings in W3 Total Cache plugin the PS service actually made the page load slower… So I assume it wont make wonders and you can still achieve good results just with this plugin.

    well I am a beginner in this, so just sharing my experience
    J

    Here’s what I figured out about how to eliminate all render-blocking JS & CSS:

    Install W3 Total Cache

    Go to Minify

    Use the “help” wizard that you can see as a button near the top

    Accept the suggestions without making changes. This will combine all your CSS files into 1, and all your JS files into 1, 2 or 3, depending where you load them (if you load all in the same area, e.g. in the <head>, you’ll only get 1 combined file).

    Set all JS to “Non-blocking using Async”.

    Now test your site. If everything works, the only blocking CSS/JS file left should be your combined CSS file, and nothing else.

    Most likely some JS functions won’t work properly anymore. If this is the case, it gets a bit more complicated.

    In this case, try the following:
    Remove all the JS files in the Minify settings of W3

    Open the source of your functioning page where no JS files are combined and manually add to W3 Minify ONLY the JS files found in the header (since these are the ones “above the fold”) and IN THE ORDER that they exist in your source file. Try this. If it works, try moving them all into the <body> or just before the </body> using the Minify JS settings.

    In my case, I had a strange issue whereby combining jquery.js with the other JS files broke many js functions that depend on jquery even though they loaded after. To get around this I made jquery.js load on its own after <body>, and made all the others load combined just before </body>, with everything set to load using async.

    Using this method, the only “above the fold” problem I have is the combined CSS sheet.

    If your combined CSS is small, you can try inlining the entire thing.

    If not, the only way around this that I currently know is to manually inline only the relevant parts of this combined CSS, and then to load the combined CSS in the footer using JS.

    If someone knows of a way to automatically inline only the relevant CSS, I’d be very happy to hear!

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Eliminate external render-blocking Javascript and CSS in above-the-fold content’ is closed to new replies.