Important: as of Autoptimize 2.7 the critical css functionality is fully integrated, no need to add/ install this power-up any more. Further improvements will be done in Autoptimize, but the power-up will remain available here for now.
This plugin extends Autoptimize to automatically create critical CSS rules. These rules inject the correct critical CSS in different types of pages to ensure these pages are rendered even before the full CSS is loaded, improving the “start to render time” and user experience. For this purpose the plugin integrates with criticalcss.com, a 3rd party service, to have it generate the critical CSS (see FAQ for info on pricing).
Simply install and activate the plugin (you will need to have Autoptimize up and running), enter your https://criticalcss.com API key and the plugin will automatically start work to create rules.
If you want to change settings or review the rules, you can find these by clicking the “critical css” tab on the Autoptimize plugin settings screen. There are “installation instructions” and more info in the FAQ.
At the time of writing (4 May 2018) the price for using CriticalCSS.com is:
£2/month for membership + £5/domain/month.
This means the total cost will be £7/month if you use this plugin for one site.
If you’re not sure yet; with the 30 day free trial, you have nothing to lose!
No; CriticalCSS.com needs the pages for which it has to generate critical css to be publicaly visible to work.
Critical CSS generation is based on a job-queue. For jobs to be added to the queue, your site should have requests and those requests should not be served by a page cache (because in that case WordPress and Autoptimize are not triggered). If you want to speed things up, you can temporarily disable your page cache and click around on your website yourself.
Once a job is in the queue it can be executed and sent to criticalcss.com and at one of the next queue runs the critical CSS is retrieved and turned into a rule and it will be used for the next matching request (again for a page not in page cache).
When just installed the plugin will be more active, generating new jobs and for most of those jobs making calls to criticalcss.com. As rules are automatically generated that way, the number of jobs and the number of requests to criticalcss.com will go down significantly.
Most importantly; as the bulk of the work is done asynchronously (by the cronned queue processing job), there is no negative impact on the performance of your site, so your visitors will not notice any slowdown.
Autoptimize CriticalCss.com power-up uses scheduled jobs to go over a queue with URL’s for which to fetch critical CSS. If there are many items in the queue, the process can take a couple of minutes to finish. If your hosts limits the time scheduled PHP processes can run, you can change the number of requests sent to criticalcss.com (the “request limit”) under the Advanced Options (default is 5).
As from AO CCSS 1.7 there is an (advanced) option you can activate to enforce PATH-based rules creation for pages so each page will end up with its own critical CSS.
Yes; create a manual rule (can be both path- and conditional-tag based) and enter
none for critical CSS. If the rule matches, no critical CSS will be added and the full CSS will be inlined instead.
If all jobs remain in “N” (and one
is_front_page job is “P”) then wordpress “cron job” that does the queue processing is not getting triggered. To verify you can install the “wp crontrol”-plugin and then under Tools -> Cron Events look for “ao_ccss_queue” and check the “next run” time/ date.
If the “ao_ccss_queue” job is not there, you’ll have to de- and re-activate the “autoptimize critical css” plugin to have it re-register the queue-processing task.
If the “ao_ccss_queue” job is there, but has a “next run” date in the past, there is an issue with your site/ hosters WordPress cron and you will have to contact your hoster. Some hosters’ info on the topic: WP Engine, BlueHost, HostGator and SiteGround.
This is caused by mod_pagespeed, which -wrongly- assumes the full CSS is not needed any more. You will have to reconfigure mod_pagespeed to prevent this from happening, the solution in this forum-reply might help.
Ensuring the CSS is not render-blocking through this plugin is a first important step to improve rendering performance, but to get a significant better first paint time, you’ll need to ensure you have no other render-blocking resources.
* for jQuery: try enabling the advanced “Defer jQuery and other non-aggregated JS-files?”-option (introduced in AO CCSS 1.12.0). This will also wrap inline JS that depends on jQuery in a function for it to be executed late as well. Test your site thoroughly after enabling this option and disable it if anything breaks!
* for Google Fonts: try the options on Autoptimize “Extra” tab. Remove Google Fonts is great but might be too aggressive for designers, “aggregate CSS & Preload” is a good alternative that is inline with what Autoptimize does with CSS.
* for YouTube videos: try a plugin that lazyloads embedded videos (e.g. WP YouTube Lyte).
As of AO CCSS 1.13.0 the plugin binds itself to a domain to avoid unexpected requests from cloned sites. You can either deactivate and reactivate the plugin to reset the “bound domain” or you can pass
false to the
autoptimize_filter_ccss_bind_domain filter to disable the domain binding.
Autoptimize criticalcss.com power-up adds automated critical css creation to Autoptimize integrating with the https://criticalcss.com service.View Cart
This plugin inserts social share links at the top or bottom of each post.
Search & Replace data in your database with WordPress admin, replace do...
Flexible button creator allowing you to stick floating buttons to the side ...
Remove meta author and date information from posts and pages. Hide from Hum...