Keep Them Sparkling.
"White is always tough, but if you’re trying to keep them as white as possible, I’d suggest giving them a quick once over with ScotchGuard spray . . . that will make it tougher for stains to adhere. Then I’d make sure that when you wash, machine wash with other whites in warm water (not hot), and don’t overload the machine, as you need your jeans to be rinsed thoroughly. If they’re not rinsed thoroughly, detergent residue can lead to yellowing. One last trick is to add a 1/4 cup of baking soda to the washing machine during the rinse cycle instead of using conventional fabric softener. It will soften and whiten at the same time."