# Purge plugin for PG available! Fixed, I think!

**URL:** <https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050>\
**Category:** Third Party Plugins\
**Created:** [May 1, 2020, 7:43pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050 "2020-05-01T19:43:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [May 1, 2020, 7:43pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/1 "2020-05-01T19:43:42Z")

</div>

EDIT: I think we are working on all platforms!!  
No plans ever suffer the heat of battle! I thought I had tested well enough, but as it turns out I didn’t understand how Pinegrow handles files well enough. I fell back to straight Node.js and NW.js and things seem to be working on Mac, PC, and Linux. I’ve tried to test as much as possible, but there is still the possibility you will have the one circumstance I didn’t test/make-work arounds for! That being said, the plugin page is back. It is with great humility that I apologize for time wasted.

~~EDIT: Nope - fixed for some, but not all operating systems. For some reason I think that the Node.js file creation is failing on some operating systems. Trying to get fixed quickly!~~

~~EDIT: My apologies for the (too) early release of my free plugin below. All fixed now! (At least I think it is.)~~

~~As it turns out, it wasn’t something I stripped out before archiving! I forgot to convert URL names back to file names, so anytime there was a space in a folder or filename it would choke. In my testing I didn’t hit upon this before release.~~

~~EDIT: Ahhhhh - I stripped some development files out before compressing and uploading and broke the plugin. I’ll get a new working version up soon. Soory all. Serves me right for trying to get the plugin out after a looooong day.~~

I’ve put out a new free plugin that I think many people here on the forum will find useful. In other threads I’ve seen people unhappy with the size of the CSS files used for a number of Frameworks. Well, now you can Purge It!

First, the disclaimer! The plugin hasn’t been tested nearly as much as it should probably, but I don’t think there are any major bugs. It should do what it says, but there may be cases when it doesn’t perform as well as expected.

So, what is it! Well, this new plugin implements the [PurgeCSS](https://purgecss.com/) JavaScript library within Pinegrow. It allows you to run all of your HTML and CSS files through the library to output a single CSS file that contains only the rules that have been used in your project. Slim that Bootstrap.css file down before minifying it! Say “No!” to huge Tailwind CSS styling files.

Hope everyone enjoys and gives feedback!

YouTube video - watch at high speed- I’m a bit sloth-like this morning! [https://www.youtube.com/watch?v=tlL8U6mJzCs](https://www.youtube.com/watch?v=tlL8U6mJzCs)

[https://plugins.springhilldesign.net/purge-plugin-for-pinegrow/](https://plugins.springhilldesign.net/purge-plugin-for-pinegrow/)

---

<div class="post-metadata">

**Author:** ![AllMediaLab](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/allmedialab/32/2079_2.png) [@AllMediaLab](https://forum.pinegrow.com/u/AllMediaLab)\
**Post date:** [May 2, 2020, 7:07am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/2 "2020-05-02T07:07:30Z")

</div>

Nice! Going to try it soon!

Warm Regards & Thanks a lot!

David

---

<div class="post-metadata">

**Author:** ![Marf](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/marf/32/1799_2.png) [@Marf](https://forum.pinegrow.com/u/Marf)\
**Post date:** [May 2, 2020, 7:27am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/3 "2020-05-02T07:27:54Z")

</div>

@RobM Thanks! Plugin Master, King of the plugins! 😍  
Interesting and powerful addition. Really nice to have this feature inside Pinegrow.  
❤🌲

---

<div class="post-metadata">

**Author:** ![zedbuza](https://avatars.discourse-cdn.com/v4/letter/z/bbce88/32.png) [@zedbuza](https://forum.pinegrow.com/u/zedbuza)\
**Post date:** [May 2, 2020, 8:14am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/4 "2020-05-02T08:14:34Z")

</div>

hey Rob, thanks for the plugin and all the hard work and time your giving in for the community

---

<div class="post-metadata">

**Author:** ![schpengle](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/schpengle/32/238_2.png) [@schpengle](https://forum.pinegrow.com/u/schpengle)\
**Post date:** [May 2, 2020, 9:29am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/5 "2020-05-02T09:29:53Z")

</div>

STATUS: @RobM :\> _UPGRADE_ :\> **Godlike**

This has been soooo needed for so long!  
Not just for Pinegrow, but an easy imlementation within ANY app that uses these behemoth style libraries.

Luckily for us, we have you AND Pinegrow App!

If/when I finish this _sewing my fingers to things_ in the not to remote future, I’m so looking forward to trying this out.

At last!  
Cheers

---

<div class="post-metadata">

**Author:** ![AllMediaLab](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/allmedialab/32/2079_2.png) [@AllMediaLab](https://forum.pinegrow.com/u/AllMediaLab)\
**Post date:** [May 2, 2020, 7:38pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/6 "2020-05-02T19:38:04Z")

</div>

Hi Bob,  
Try to download your new plugin, but unfortunately is the web page with the plugin gone! 😉  
Regards,  
David

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [May 2, 2020, 9:27pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/7 "2020-05-02T21:27:31Z")

</div>

Hey David - if you look through the flurry of edits at the top of the post you’ll see that I didn’t take proper account of how Windows and Mac file systems differ. path.normalize is your friend. At any point, I had deactivated the download page when I realized there were problems. It is back live now. I hope there are no problems. I’m a bit frazzled with all of the trouble-shooting and cross-platform testing!  
Cheers,  
Bob

---

<div class="post-metadata">

**Author:** ![CodeBloodedDev](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/codebloodeddev/32/2568_2.png) [@CodeBloodedDev](https://forum.pinegrow.com/u/CodeBloodedDev)\
**Post date:** [May 2, 2020, 11:53pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/8 "2020-05-02T23:53:04Z")

</div>

Awesome work. No apologies needed, you’ve dedicated your time and also made it free at your own expense. Thank you and it is much appreciated.

---

<div class="post-metadata">

**Author:** ![AllMediaLab](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/allmedialab/32/2079_2.png) [@AllMediaLab](https://forum.pinegrow.com/u/AllMediaLab)\
**Post date:** [May 3, 2020, 1:37pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/9 "2020-05-03T13:37:02Z")

</div>

Hi Bob,  
Working great! Thanks again!  
Would it be possible to add multiple folders loading and html from different folders in the future?  
Because we use multi language websites with 4 languages and non uniform styling for every language.  
Regards,  
David 😉

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [May 3, 2020, 1:51pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/10 "2020-05-03T13:51:05Z")

</div>

I guess I could add multiple input fields for both the HTML and CSS. I guess it wouldn’t be that tough.

---

<div class="post-metadata">

**Author:** ![grimur](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@grimur](https://forum.pinegrow.com/u/grimur)\
**Post date:** [May 5, 2020, 9:01pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/11 "2020-05-05T21:01:24Z")

</div>

Hi Bob,  
great work with the plugin. One thing I wanted to ask. Does the plugin also work when using wordpress, because I tried it and it broke my page, a part of the bootstrap styling.

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [May 5, 2020, 10:15pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/12 "2020-05-05T22:15:42Z")

</div>

So the PurgeCSS JavaScript should go through any template files that you input and compare all of the found classes and ids to the styling rules. So, it should work, but I don’t think I enabled \*.php files. Were you able to select them for scanning? I haven’t looked at the library close enough to se if it would choke on non-HTML files.

---

<div class="post-metadata">

**Author:** ![red-rosefields](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/red-rosefields/32/5392_2.png) [@red-rosefields](https://forum.pinegrow.com/u/red-rosefields)\
**Post date:** [May 12, 2020, 9:07am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/13 "2020-05-12T09:07:57Z")

</div>

Hi Rob, Fantastic! Thanks a lot for sharing this with the rest of us. I tried it last night on a 4 pages site and it brought down my style.css from 28KB to 12KB.  
Now what is the best practice to apply/replace my before purged style.css file. Rename it style.css.old and rename the purge.css file to style.css and drop it to the canvas?  
Many Many Thanks for this plug in!

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [May 12, 2020, 9:19am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/14 "2020-05-12T09:19:23Z")

</div>

I’m not completely sure what best practice would be, but that is the way I would do it 🙂. As long as you don’t get rid of the old style sheets in order to recover if something went wrong that you don’t discover until later.  
Cheers,  
Bob

---

<div class="post-metadata">

**Author:** ![mhigaki](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/mhigaki/32/2788_2.png) [@mhigaki](https://forum.pinegrow.com/u/mhigaki)\
**Post date:** [July 30, 2020, 11:18pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/15 "2020-07-30T23:18:28Z")

</div>

Pinegrow Web Editor - 5.971 - error when adding the plugin.

 ![Captura de tela_2020-07-30_20-12-52](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/c/c1e7ececa23a1c810c6ddafe39898c77489cb446.png)

Error message when selecting the CSS folder.

 ![Captura de tela_2020-07-30_20-14-46](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/d/d24c0da43f4ed56b949100a1d88ecfb191381d32.png)

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [July 31, 2020, 9:47am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/16 "2020-07-31T09:47:05Z")

</div>

Hi @mhigaki,  
I look into this today. What OS are you running?  
Bob

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [July 31, 2020, 1:59pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/17 "2020-07-31T13:59:36Z")

</div>

Hi @mhigaki - thanks again for bringing this to my attention. It turns out this is also a breaking update for the Purify plugin. ☹  
I don’t see anything in the nw.js or node changelogs that explain this change in behavior.

---

<div class="post-metadata">

**Author:** ![mhigaki](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/mhigaki/32/2788_2.png) [@mhigaki](https://forum.pinegrow.com/u/mhigaki)\
**Post date:** [July 31, 2020, 8:57pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/18 "2020-07-31T20:57:23Z")

</div>

|Description:|Ubuntu 20.04.1 LTS|  
|Release:|20.04|  
|Codename:|focal|

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [August 1, 2020, 9:39am UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/19 "2020-08-01T09:39:32Z")

</div>

Thanks,  
I think it has been fixed for the update. I’ll post later.

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [August 1, 2020, 6:15pm UTC](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050/20 "2020-08-01T18:15:29Z")

</div>

A new version of the Purge plugin has been posted. You can go to the plugins page and download it. Fair warning, it does not work with the local CSS file for TailwindCSS. Pinegrow loads in Tailwind through a CDN, so it doesn’t really matter, but if anybody is using the local file version, it won’t work. I’m modifying the Purify plugin so that it will.

[Next page](https://forum.pinegrow.com/t/purge-plugin-for-pg-available-fixed-i-think/4050.md?page=2)
