Sorry to invade the ladies only forum but I could not resist this topic. When the white pants come home [always with a black or colored stripe so bleach is always scarry] I soak them in a strong Oxyclean or like solution [off brand] in hot water. I soak them for at least three hours or sometimes all night. I rinse them out with cold water before machine washing. If you just have dirt, for the machine wash I suggest Tide with bleach alternative [color safe] and a product called "Dissolve" which I have found in laundry mats and is used by the oilfield workers here in West Virginia. If there are grass stains, I use Shout in the tube and rub it in on both sides of the stain [inside and out] and let it set for at least 20 minutes before placing it in the machine washer. A particularly stubborn dirt stain that survives the Oxyclean bath and rinse will get Tide with bleach alternative poured on the stain directly on both sides and rubbed in with a battery operated small swirling brush [available as a combined product at most grocery stores].
I do all the washing in our house so my wife loves me very much.