• Resolved seohubnl

    (@seohubnl)


    @gabelivan

    Hi Gabe,

    Google Lighthouse reports advise to remove unused CSS output from the plugin Asset Cleanup. How to solve this?

    Thanks,

    Martijn

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @seohubnl Note that the output is not from Asset CleanUp, but from the original file, you already had. Asset CleanUp does minify files and they will point up to the plugin’s caching directory, but the unused CSS (even though it’s minified and takes less disk space) is obviously still there even after minification (this happens with any minification tool out there). So, the quickest way to reduce the size of the unused CSS reported by Google PageSpeed Insights and any other tool (Lighthouse in your case) is to use the main plugin’s feature which is unloading CSS that you don’t need.

    After inspecting your website by appending /?nocache to the URL (which will prevent any combination of the assets and will allow me to clearly view each file individually instead of a large combined one that is harder to analyze), I noticed in the Google Coverage tool that you are loading a few CSS files that are not needed on the homepage (and for sure on other pages as well). Please check the attachments I made that highlights one example of a file that is having 100% of its code unused.

    The files I found are:
    – /wp-content/plugins/supreme-modules-for-divi/styles/style.min.css?ver=2.1.3
    – /wp-content/plugins/woocommerce/assets/css/woocommerce-smallscreen.css?ver=4.0.1

    Desktop print screen: https://ibb.co/XxBf4pn
    Mobile print screen: https://ibb.co/6Zz9dW0

    PS: Be careful with unloading any CSS to Google Fonts as I’ve often noticed that it is reported as being unused, but in fact, it is used. So, you have to double-check that whenever you’re unloading a CSS file pointing to fonts.googleapis.com as it might be needed.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove unused css by Asset Cleanup plugin’ is closed to new replies.