Site logo

[Support request] Identify “unused CSS” and “not existing CSS” in child files

Home Forums Support [Support request] Identify “unused CSS” and “not existing CSS” in child files

Home Forums Support Identify “unused CSS” and “not existing CSS” in child files

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1582174
    Walter Schwarz

    Is there any feature implemented or plugin recommended to

    1) identify “unused CSS” defined in child files and not used in html code (like online https://unused-css.com/),
    2) identify “non existing CSS” in child files defined as class/id in html code?

    I would like to use this in the development phase – and it’s not to eliminate whole CSS-pages.

    Thanks for any hint and support,
    Walter

    #1582206
    Elvin
    Staff
    Customer Support

    Hi,

    Is there any feature implemented or plugin recommended to

    To answer directly: No, we don’t have this particular feature implemented.

    As for recommendations:

    In general, its best to use as less plugins as possible as too many of these can slow down the site.

    That said, sites like you’ve mentioned or Chrome’s devtool should help you identify how much is not being used.

    If you must use a plugin, you can try Asset CleanUp plugin but we really can’t guarantee its effectivity as it is a third party plugin.

    Note: This is pretty tricky to do as there are dynamic CSS within the theme. That means you can’t use only 1 page to CSS purge as some of them may not used on the page being tested but is used on another.

    You can try following these articles but there’s a chance you’ll break the layout if you’re not sure what you’re doing:

    https://wpspeedmatters.com/remove-unused-css-from-wordpress/
    https://technumero.com/remove-unused-css/#Tools_to_detect_unusedused_CSS

    #1582211
    Walter Schwarz

    Thank you Elvin.

    I just want to clean my child CSS files. So there would not be a problem with “dynamic CSS within the theme”, right?

    And I will try your hints …,
    Walter

    #1582215
    Elvin
    Staff
    Customer Support

    I just want to clean my child CSS files. So there would not be a problem with “dynamic CSS within the theme”, right?

    Assuming you didn’t dequeue or change anything on the default stylesheets of the parent theme then there shouldn’t be that much of an issue as there’s a fallback (the parent stylesheet). 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.