I don't have a recipe, but I've used "Folex". You can buy it at Lowes, Home Depot or grocery store. It comes in a tall white spray bottle. It takes out stains instantly and I've never had one bleed back through. Good luck!
What color is your carpet first?
Have you tried having it professionally cleaned?
Here are questions related to Homemade Multi-Purpose Carpet Cleaner.
Does anyone have a recipe to get any type of stain out of carpet?
Crystal from Wrarragul, Vic
RE: Homemade Multi-Purpose Carpet Cleaner
I make my own mixture. I use a spray bottle (I use an old carpet spot remover bottle), 1 scoop Oxi-Clean, 1/3 cup carpet cleaner (for shampooer), and top off with water. It takes all sorts of stains out of my carpet and my carpet is light colored. I use it on pet stains (we are housebreaking a puppy), mud spots, kids spills, etc with a lot of success.