• Resolved naplaz

    (@naplaz)


    Hello, can this plugin remove unused css inside a style sheet? I mean insted of blocking the entire css file, i would like, for example, remove only RTL related code, because my website is for a specific country, and there is no need of RTL text display and all related css.

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

    (@gabelivan)

    @naplaz Asset CleanUp does not have a feature that allows you to just strip certain CSS within a file. However, there’s a feature that can be used which is the ability to load an alternative version of an existing file. This is obviously for files that should be kept loaded, but you want to load a lighter version of them.

    If you’re comfortable with a bit of coding (in fact, it’s more copy & paste), you can edit your functions.php from the Child Theme. Here’s the documentation on how to do that: https://www.assetcleanup.com/docs/how-to-load-an-alternative-lighter-version-of-a-file/ – I’m using this option whenever I have to optimize a certain page. In my experience, it’s worth it if there’s plenty of CSS code to remove (e.g. half of the CSS from a 300 KB file) so that it would make a difference when testing the page in Google PageSpeed Insights. However, some prefer to clean up the page as much as possible. It’s up to you if it’s worth the effort.

    Note that if the original file changes (e.g. you update the plugin behind that file), you need to update the alternative version too, so it’s a bit of maintenance.

    Good luck with it and happy winter holidays!

Viewing 1 replies (of 1 total)

The topic ‘Remove css inside a file’ is closed to new replies.