S.B.
I had very light, not quite white carpets in my last house.
I used Fels Naptha. It comes in a bar like soap and works great on stains. You want to test first...but white carpets shouldn't be a problem.
I put the bar in a bowl of water and let it set for a bit to make a sudsy solution or got it wet and just scrubbed the bar on spots then scrubbed with a brush.
Wear gloves. It can be a little harsh on your skin if you have your hands in it for a while. I also made this sudsy solution to put in my carpet shampooer and it made the carpets come out great.
A bar of Fels Naptha only costs a few dollars, lasts a long time and I can buy it at my rural market.
I've used it for a lot of things. Especially carpets.
Best wishes.