Hack Forums
Unused CSS Wordpress Questions - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Unused CSS Wordpress Questions (/showthread.php?tid=6054897)



Unused CSS Wordpress Questions - Deployed - Mar 5, 2020

Hello HackForums, Deployed Here

I am currently removing unused css from all of my source files over at WordPress; but had a thought..

Is manually removing the Unused CSS from Plugin CSS files redundant? As in the case they will just "revert" upon updating that plugin?

- Deployed


EDIT: This may need to be in the wordpress section


RE: Unused CSS Wordpress Questions - Nachfolger - Mar 5, 2020

(Mar 5, 2020 01:20 PM)Deployed Wrote:  Hello HackForums, Deployed Here

I am currently removing unused css from all of my source files over at WordPress; but had a thought..

Is manually removing the Unused CSS from Plugin CSS files redundant? As in the case they will just "revert" upon updating that plugin?


EDIT: This may need to be in the wordpress section
You answered your own question. If the update implements new CSS, then it will just put the removed styles right back where they were.


RE: Unused CSS Wordpress Questions - Deployed - Mar 5, 2020

(Mar 5, 2020 01:52 PM)Nachfolger Wrote:  You answered your own question. If the update implements new CSS, then it will just put the removed styles right back where they were.

I figured as much and wanted to verify. Thank you for that

- Deployed


RE: Unused CSS Wordpress Questions - Disease - Mar 28, 2020

(Mar 5, 2020 01:20 PM)Deployed Wrote:  
Hello HackForums, Deployed Here

I am currently removing unused css from all of my source files over at WordPress; but had a thought..

Is manually removing the Unused CSS from Plugin CSS files redundant? As in the case they will just "revert" upon updating that plugin?

 - Deployed



EDIT: This may need to be in the wordpress section

It depends on how you do it. If you're editing the CSS of the plugin directly, then yeah, you need to be cautious about updating the plugin. Your changes are likely to be overwritten.

There are more permanent, slightly more future-proof ways of doing this. Including reading through your plugins, ensuring they properly enqueue their styles, and via your functions.php file, dequeue them. You would then have to bring the CSS you're keeping from the plugin to your theme. But, if the plugin updates and makes changes to the markup generated, or classes applied to the markup, then you'll need to adjust.

Long story short, the unfortunate truth of WordPress websites is that they are prone to this kind of bloat. Until WordPress implements a far more robust assets pipeline there's little hope for truly streamlining CSS brought in by plugins. Other than minimizing how many plugins you use, of course.


RE: Unused CSS Wordpress Questions - Deployed - Mar 28, 2020

(Mar 28, 2020 05:30 PM)Disease Wrote:  It depends on how you do it.  If you're editing the CSS of the plugin directly, then yeah, you need to be cautious about updating the plugin.  Your changes are likely to be overwritten.

There are more permanent, slightly more future-proof ways of doing this.  Including reading through your plugins, ensuring they properly enqueue their styles, and via your functions.php file, dequeue them.  You would then have to bring the CSS you're keeping from the plugin to your theme.  But, if the plugin updates and makes changes to the markup generated, or classes applied to the markup, then you'll need to adjust.

Long story short, the unfortunate truth of WordPress websites is that they are prone to this kind of bloat.  Until WordPress implements a far more robust assets pipeline there's little hope for truly streamlining CSS brought in by plugins.  Other than minimizing how many plugins you use, of course.

Very very late response, but I appreciate it nevertheless. This is exactly what I was intending, and acknowledge is the downside with Wordpress; as you just wait for plugin hosters to revise their own CSS. This is when you just snag a CDN and call it equal (as I have done since)

- Deployed