I agree that fixing the problem at the source is the best solution. Unfortunately, when recording electric guitar, it's sometimes very difficult to eliminate hum altogether. True enough, the guitarist should find the sitting angle that produces the minimum noise. But if you're using a high gain amp, that may not be enough, even with humbucking pickups. And many people (myself included) prefer the sound of a real amp to amp simulation plugins. There's all kinds of steps that can make it better, from insulating the pickup and control cavities of the guitar to being careful with your lighting and wiring and so on, but even at the best you're going to get some hum if you're using an amp turned up loud with enough gain to produce a really distorted signal.
Fortunately, most of the time when a high gain amp is being used, the guitar is playing so loud that the hum isn't noticeable, unless it's horrifically bad. The weak spots where the hum becomes audible will generally only be on notes and chords that are allowed to die out. And even on those, it's usually possible to keep the hum down with envelopes except at the end of the song or when there is a pause with nothing else playing.
This is where noise removal plug-ins can really help a lot. I used to use the one that comes with Sound Forge, now I use Izotope RX5 (which does a heck of a lot more as well). Of course, there are others. The important thing is to be sure to capture some of the hum on its own (no playing and no other sounds) to use as a noise footprint to tell the software what to remove. There are hum cancellation EQ settings as well that depend on sharply cutting at 60Hz and its multiples (or 50Hz in most of the world) but I find these less effective most of the time.