• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » How to Load CSS Without Blocking Rendering (WordPress & Others)

By Abhishek Ghosh October 14, 2016 7:51 am Updated on November 4, 2016

How to Load CSS Without Blocking Rendering (WordPress & Others)

Advertisement

Previously, we talked about how to deliver Javascript in blocking way and Defer Parsing of Javascript in WordPress. CSS part on that guide was probably not optimal. Here is How to Load CSS Without Blocking Rendering in WordPress & Others. Render Blocking CSS is Common Error on Google PageSpeed Insights. In this guide, we will remove the rest of the blocking CSS.

 

How to Load CSS Without Blocking Rendering WordPress : Where To Start From?

 

Problems are more in WordPress as control of delivery CSS, Js is lesser. For the sake of GooglePage Speed, this is very good plugin :

Vim
1
https://wordpress.org/plugins/async-js-and-css/

There are more such plugins for WordPress. On that plugin, we use this setting :

Advertisement

---

Load Javascript asynchronously [ticked]
Detect tags in wp_head [not ticked]
Load CSS asynchronously [ticked]
CSS loading method [(default)Inserting all CSS styles inline into the document HEADER]
Minify CSS [ticked]
Remove “?ver=XXX” part from URLs [ticked]
Exceptions (files to ignore and load in render-blocking way) [none]

That settings inline some CSS leaving Font CSS, Icon Font CSS and other few CSS to inline. They show as Load CSS Without Blocking Rendering message on Google PageSpeed Insights. This may be your case or slightly different. We already made critical CSS inline.

 

How to Load CSS Without Blocking Rendering WordPress & All Others

 

Normally we load CSS in this way :

Vim
1
<link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css" media="all">

But if we load the same in this way :

Vim
1
<link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css" media="none" onload="if(media!='all')media='all'">

The CSS not going to block the rendering. But the technique uses JavaScript. For the browsers with no-JavaScript enabled, we need to offer a second way (which is blocking way) :

Vim
1
2
<link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css" media="none" onload="if(media!='all')media='all'">
<noscript><link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css"></noscript>

But if you add both set to header, again on Google PageSpeed Insights on mobile you’ll get info that CSS is blocking rendering. So final fix is, put this part on header :

Vim
1
<link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css" media="none" onload="if(media!='all')media='all'">

and the noscript part on footer :

Vim
1
<noscript><link rel="stylesheet" href="https://cdn.thecustomizewindows.com/css1.css"></noscript>

I have not seen problem on MacOS Safari, Chrome, Firefox with this method for non-critical CSS. MacOS Opera probably can not load properly. We hope, you’ll get some score like this :

how-to-load-css-without-blocking-rendering-wordpress-others

For making failsafe, I have to send you here :

Vim
1
https://github.com/filamentgroup/loadCSS

Quick info on Defer Parsing of Javascript and Eliminate Render Blocking Script in WordPress:

This is non-blocking way for individual CSS :

Vim
1
<link rel="stylesheet" href="https://cdn.domain.com/my.css" media="none" onload="if(media!='all')media='all'"><noscript><link rel="stylesheet" href="https://cdn.domain.com/my.css"></noscript>

Why, that is explained above.

This is non-blocking way for individual Js :

Vim
1
<script type='text/javascript' src='https://cdn.domain.com/my.js' async defer>execOnReady(function(){execOnReady(function(){});});</script>

Why, that is explained elsewhere on this website.

Tagged With Eliminate render-blocking resources css/stylesheet without plugins , https://thecustomizewindows com/2016/10/load-css-without-blocking-rendering-wordpress-others/ , wordpress css loading slow

This Article Has Been Shared 201 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Load CSS Without Blocking Rendering (WordPress & Others)

  • Configuring WP Super Cache With Origin Pull or Origin Push CDN

    Configuring WP Super Cache with a CDN is a bit tricky but if properly done if works great. In this tutorial, we will show to configure WP Super Cache with both Origin Pull and Origin Push CDN.

  • List of Open Source PHP MySQL Based Blogging Softwares

    List of Open Source PHP MySQL Based Blogging Softwares lists the most commonly used and available softwares those can run on any LAMP server easily.

  • Bootstrap Genesis Child Theme : Do it Yourself Guide

    Bootstrap Genesis Child Theme can easily be created by modifying the default CSS of existing Eleven40 Child Theme plus some custom templates. Here is how.

  • WordPress Post to Downloadable PDF, Text : Practical Options

    WordPress Post to downloadable PDF, Text has many points to consider when we will think about the usability, SEO, HTML5 and Schema.org markups.

  • Icon-Font : Using with WordPress

    Icon-Font is Icons but is in Font format – that simply means, what you used commonly as image and increased your page loading time can be reduced and made cool.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Projector Screen Basics February 6, 2023
  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023

About This Article

Cite this article as: Abhishek Ghosh, "How to Load CSS Without Blocking Rendering (WordPress & Others)," in The Customize Windows, October 14, 2016, February 6, 2023, https://thecustomizewindows.com/2016/10/load-css-without-blocking-rendering-wordpress-others/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT