Both hubby and I have a lot of hats and we don't put any in the washing machine, but have over the years used products that work to clean them. First of all, don't use any solvent, pre-spotter or cleaner that leaves a residue. Though it may remove the stains initially, the residue attracts dirt and sweat to become a worse stain later. We have found to remove overall grime, dry granulated carpet and upholstery cleaner works well, doesn't leave a residue and brightens the color. Both Resolve and Capture make one and you can put the hat in a container, fill it with some cleaner and use a soft brush to agitate it into the fibers of the hat. By so doing, you also maintain the shape and color. If you have sweat or dirt stains, upholstery and carpet cleaners work well. Some that we use with success are Folex, Spot Shot, Resolve with Oxycleaner, none of which require rinsing and unlike laundry spotters which are meant to be diluted later with water, don't leave a ring or residue on the fabric. A final note, I store my hats over a container filled with baking soda, talc powder, cornstarch, borax, even carpet fresh as they all absorb odors, with an old pillow case over it to keep them dust free. Many of our hats, in fact most of them are decades old.