I was going to say exactly the same thing as Dave. Grounds are there for more than one reason, and stopping hum is the most minor thing they do. Over the years - I'm surprised more musicians haven't died, but musicians are often the naturally lucky ones! when these topics come up, I look at my right hand - that's a burn from the edge of a radio mic receiver case - a gig in the late 80s with a well known band, who had removed their ground to get rid of some hums, but the radio receiver WAS grounded, and all I did was creep on stage and try to put back in a guitar jack that had tugged out. I reached over the back of the amp, grabbed the jerked out plug, in my right hand and as I went to plug it back into my hand, I brushed the receiver case, and it threw me across the stage. The scar is the result.
In fairness - most of these hums that vanish are because all the pickups by design contain components that work by magnetic coupling. Those that don't are often very sensitive devices doing lots of amplification and our environment is full of interference. Our nice flabby bodies are pretty good at damping all this, and providing screening and potential grounding (like the bare feet thing). Making to worse is leakage current. Grounds are rarely at ground potential. They should be, but they're not and if multiple grounds exist - which one is the right one? Connecting different systems by touch can restore this equal potential, but to do it, the current passes through your body. When it happens through your lips touching a mic, it tingles. Most times it's not dangerous because current is tiny and your lips are sensitive. However, like my scar - sometimes, perhaps rarely thank goodness, the current is a real fault. A broken turn in a transformer, a ground wire come off and touching a live component where it's been thrown in the truck once too often. In these cases, it's genuinely dangerous. I've seen people with mains power connectors and a cable coming out from the ground pin with a big car battery style connector on the end - and they attach this when things hum. It usually works of course, but one day they'll stick it on a metal jack on that faulty amp, and there will be a huge bang.
I suppose I'm saying that curing hums needs some knowledge of what you're actually doing to keep safe. Often, you can cure it, but have you? You solved the hum, but did you determine if it's a teeny fault, or an annoying coincidence and just equipment that hates other equipment, or something more dangerous?