Having some here and there is great for "feel" but I think you're probably more referring to those very pronounced, ear piercing squeaks. It is all technique, fingers moving slightly on the thicker gauge strings with high gain just creates it. I'll frequently just scrap otherwise good takes and re-do them until I can get a pass with a good performance and less excess noise. Lifting up the fretting fingers helps but it is a give and take because the performance / riffs will suffer. Also I've found that it is a bit more prominent on guitars with clear/hifi/unforgiving pickups (not sure the right word, but a lot of the metal geared Bareknuckle pickups come to mind), same with guitars that don't have a tone pot.
Product wise - Fast fret doesn't cut down on the squeaks (great for cleaning the strings though). Finger-Ease String Lubricant Spray helps a little bit but it isn't as night and day as the reviews would lead you to believe.
I'm sure someone more handy with Protools / Logic / Reaper has some mixing tricks for reducing the effect. They can be edited out but its just less effort overall to re-do the parts.