• Hey there! I am trying to Remove Render-Blocking JavaScript without adding another plugin. Everyone says to defer the file by putting the javascript at the bottom of the body tag, but where is that in WordPress? Do I need to create a child theme so that I’m not altering anything important?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Bplatt21,

    Yes, you should always make a child theme for a professional theme that you plan to edit. The biggest reason is that whenever a theme is updated the changes made to the current copy will be overwritten by the new theme update. Child theme’s essentially let the main theme load, then once loaded, insert your changes into the stylesheet, thus preserving your changes through theme updates.

    That being said, I highly recommend checking out MinQueue, it allows you to see what javascript files are being loaded on your page and then you can selectively defer javascript files. Note: the plugin hasn’t been updated in two years, though it works fine is suggested by Chris Coyier.

    If you wanted to manually defer a file you could do it by following this guide by Patrick Sexton, his site is full of great advice!

    Another note: deferring css and js from plugins can be a bit tedious, plugins like MinQueue help in this regard.
    Hope this helps!

    Thread Starter bplatt21

    (@bplatt21)

    Awesome, thanks @jjchrisdiehl You seem to know a lot about this, do you know what they are talking about when they mention “script handles” in MinQueue? Here is the phrase below

    For each queue, provide a list of script handles that will be concatenated into one file and minified. (Comma separated or on a new line)

    Multiple queues will be processed separately, creating a minified file for each. Note that scripts can be placed in the header or footer. If header & footer scripts are added to the same queue, they will still be proccessed separately.

    Thread Starter bplatt21

    (@bplatt21)

    Also, I think that I am finding there are a lot of helpful resources on https://developers.google.com/speed/pagespeed/insights/ but they aren’t giving the full URL of the JavaScript and CSS pages, do you know where I can find the full URL?

    Sorry that I am asking you, you just seem to be in the know.

    Thanks again!

    Thread Starter bplatt21

    (@bplatt21)

    Nevermind, I think I found it! I just mouse over the URL snippet and it shows me the full URL

    Thanks!
    Brian

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove Render-Blocking JavaScript’ is closed to new replies.