Three ways to remove carpet stains —
1- For fresh stains use plain baking soda, pour it dry on to the fresh spill but do not soak the baking soda. Let it foam and bubble, let it sit for a few minutes, then sponge up thoroughly.
2- For older stains, combine two tablespoons detergent, three tablespoons vinegar and one quart warm water. Work into carpet pile and blot dry. Repeat if needed.
3- Using shaving cream, let it foam on the carpet, wipe clean with sponge and rinse with damp cloth.
After any of these methods, cover the spot with a clean paper towel and place a heavy item, like a floor lamp, on top of it. Once the towel becomes damp, replace it and repeat till dry.