The zip provided below can be used to remove whole gapps package that is included in some custom Roms ,so that u can flash u r own desired gapps again [switch gapps] or if u want to use custom Roms without gapps.
Remove GApps in ROM: now support Marshmallow
Script in first post very discounted and therefore deleting not all files.
Here's updated version. Script automatically mounts /system, you don't need do it by yourself.
Script compatible with Android 2.3...6.0
Guaranteed delete will be only on CyanogenMod rom's and Nexus firmware due of possible other file naming in manufacturer stock firmware.
Probably some small bits of files can left on device (like WebView), but almost all other will be removed.
Note: script removes apps from /system partition.
Probably some of them was updated and additionally stored in internal memory.
So you need manually delete a bit of remainders by usual way.
– Maybe some stuff or whole ROM will broken after applying this ZIP
– Script removes stock Google / CM keyboard, install 3rd party before applying!
– Script removes Google Experience Launcher, so make sure you use 3rd-party app or device will not boot!
– Script removes Hangouts, so make sure you use 3rd-party SMS app or you may unable use SMS!
– ..and may other
– Apps with embedded Google Maps such as Foursquare, Instagram and many other can't be launched / installed by any way because of lack of framework for it
– A lot of apps requests installed Google Play Store and Google Play Services which will be removed
– Network location can be disabled because it's part of gapps
– Recommended to wipe dalvik/ART-cache to rid out of unused cache files
>>> Use it at your own risk and make full backup via recovery before flashing! <<<
*THE WHOLE CREDIT GOES TO BONOBOO XDA DEV HE MADE THIS CREATIVE THREAD POSSIBLE SO TX TO HIM*